Open clausreinke opened 4 years ago
currently, the following lines are dead code as child is null when monitor is called https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L120-L125
child
null
monitor
This suggests that monitor may not be used as originally intended, and it means that even successful restarts suffer from accumulated delays, keeping the child offline without reason.
Given the ressource limitations on this project, I would suggest a minor fix: after the fork (https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L162) add
fork
if (child && child.pid) { // reset attempts and wait time attempts = 0; wait = argv.w * 1000; }
Also, please don't hide the child's exit code - it is sometimes the only available clue to what went wrong.
https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L165-L166
log.warn(argv.f+' stopped running with code: '+code.toString(16));
currently, the following lines are dead code as
child
isnull
whenmonitor
is called https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L120-L125This suggests that
monitor
may not be used as originally intended, and it means that even successful restarts suffer from accumulated delays, keeping the child offline without reason.Given the ressource limitations on this project, I would suggest a minor fix: after the
fork
(https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L162) addAlso, please don't hide the child's exit code - it is sometimes the only available clue to what went wrong.
https://github.com/coreybutler/node-windows/blob/accfbd0528ad5148cb6283e5d8f2b407f890dfbc/lib/wrapper.js#L165-L166
log.warn(argv.f+' stopped running with code: '+code.toString(16));