taskworker: better logs on signal
This commit is contained in:
@@ -87,7 +87,10 @@ async function main() {
|
||||
|
||||
const debug = require('debug')('box:taskworker'); // require this here so that logging handler is already setup
|
||||
|
||||
process.on('SIGTERM', () => exitSync({ code: 0 })); // sent as timeout notification
|
||||
process.on('SIGTERM', () => {
|
||||
debug('Terminated');
|
||||
exitSync({ code: 0 });
|
||||
});
|
||||
|
||||
// ensure we log task crashes with the task logs. neither console.log nor debug are sync for some reason
|
||||
process.on('uncaughtException', (error) => exitSync({ error, code: 1 }));
|
||||
|
||||
Reference in New Issue
Block a user