diff --git a/src/taskworker.js b/src/taskworker.js index 2ee434f01..b2fe76b2d 100755 --- a/src/taskworker.js +++ b/src/taskworker.js @@ -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 }));