having the loader play nicely with supervisor -- ./nodebb watch can now hit the restart button

v1.18.x
Julian Lam 11 years ago
parent 3f7e458866
commit 7b46d66e68

@ -1,6 +1,6 @@
var fork = require('child_process').fork, var fork = require('child_process').fork,
start = function() { start = function() {
var nbb = fork('./app', process.argv.slice(2), { nbb = fork('./app', process.argv.slice(2), {
env: { env: {
'NODE_ENV': process.env.NODE_ENV 'NODE_ENV': process.env.NODE_ENV
} }
@ -14,6 +14,13 @@ var fork = require('child_process').fork,
nbb.kill(); nbb.kill();
} }
}); });
} },
stop = function() {
nbb.kill();
},
nbb;
process.on('SIGINT', stop);
process.on('SIGTERM', stop);
start(); start();

@ -37,7 +37,7 @@ case "$1" in
echo "Launching NodeBB in \"development\" mode." echo "Launching NodeBB in \"development\" mode."
echo "To run the production build of NodeBB, please use \"forever\"." echo "To run the production build of NodeBB, please use \"forever\"."
echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB"
NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- app "$@" NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- loader "$@"
;; ;;
*) *)

Loading…
Cancel
Save