- 
                Notifications
    
You must be signed in to change notification settings  - Fork 12
 
pull gateway config from GitHub #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
        
          
                server/app.mjs
              
                Outdated
          
        
      | const configPath = gptscriptConfigPath(); | ||
| 
               | 
          ||
| fs.readFile(configPath, 'utf8', (err, data) => { | ||
| fs.readFile(configPath, 'utf8', async (err, data) => { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want initGPTScriptConfig to block server startup until the file is created. Won't switching this to async mean that initGPTScriptConfig can return before the file is created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk but I'll remove it and handle everything with .then.
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
I tested this locally with an interval of 30s and it works the way it should. I set the interval here to 30m. Let me know if it should be different.
Sorry for all the random whitespace changes, lol. I guess my WebStorm settings caused that.