Log more info

This commit is contained in:
Daniel García Aubert 2019-04-04 17:26:58 +02:00
parent 5a0e3810d4
commit 12e35b02e8

24
app.js
View File

@ -125,19 +125,19 @@ process.on('SIGHUP', function() {
process.on('SIGTERM', function () { process.on('SIGTERM', function () {
global.logger.debug('Signal TERM Received'); global.logger.debug('Signal TERM Received');
listener.close(function () { listener.close();
global.logger.debug('Http server closed'); global.logger.debug('Http server closed');
server.batch.stop(); server.batch.stop();
server.batch.drain(function (err) { global.logger.debug('Batch queries stopped');
if (err) { server.batch.drain(function (err) {
global.logger.error(err); if (err) {
return process.exit(1); global.logger.error(err);
} return process.exit(1);
}
global.logger.info('Exit gracefully'); global.logger.debug('Batch queries drained');
process.exit(0); global.logger.info('Exit gracefully');
}); process.exit(0);
}); });
}); });