fix: crash on start if no config file is found
Massimo Melina committed
Mar 14, 2022 at 16:26 UTC
7b30763a18f76ec0aed27b2f02a036745275da82
1 file changed
+2
-1
server/src/config.ts
+2
-1
@@ -23,7 +23,8 @@ const path = argv.config || process.env.HFS_CONFIG || PATH
23
const { save } = watchLoad(path, values => setConfig(values||{}, false), {
24
failedOnFirstAttempt(){
25
console.log("No config file, using defaults")
26
- setConfig({}, false)
26
+ setTimeout(() => // for consistency with asynchronous success callback (without this http server is started before the koa app is ready)
27
+ setConfig({}, false) )
28
}
29
})
30