Open iteratelance opened 8 years ago
Thanks for the workaround, let's keep this open for future reference :+1:
Just wanted to add one more comment to this.
I've currently been exploring https://github.com/Unitech/pm2 and http://pm2.keymetrics.io/docs/usage/application-declaration/ rather than forever and the same issue occurs.
I've tried playing with all the following options and nothign seems to work. https://github.com/paulmillr/chokidar#path-filtering
"watch_options": {
"usePolling" : true,
"interval" : 5000,
"alwaysStat": true,
"awaitWriteFinish": {
"stabilityThreshold": 5000,
"pollInterval": 5000
},
"atomic": 5000
},
I guess for now I'll just have to restart on deploy.
If I haven't mentioned it, thanks for this tool, it's great for quick starting projects.
This is not necessarily a bug but a pretty big gotcha and I think a better solution could be implemented.
Executing the following command:
forever start -w -a -l ~/log/admin.log node_modules/express-admin/app.js ./config
Will delete your config/settings.json file.
In app.js the following code will cause the settings file to temporarily be empty and trigger a reload by forever. Ultimately this causes forever to fail and deletes the settings.json file.
A workaround is to run forever with a
--spinSleepTime
so the file has time to write.forever start --spinSleepTime=3000 -w -a -l ~/log/admin.log node_modules/express-admin/app.js ./config
Perhaps a better solution would be to maintain a schema.json file that is different from use generated settings.json and then merge them together at runtime using a loadash utility.
Something like: