Use callback properly
This commit is contained in:
parent
f2b5921ade
commit
ce04cbcb45
3
app.js
3
app.js
@ -133,12 +133,13 @@ process.on('SIGTERM', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
global.logger.info('Exit gracefully');
|
global.logger.info('Exit gracefully');
|
||||||
server.batch.logger.end();
|
server.batch.logger.end(function () {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function isGteMinVersion(version, minVersion) {
|
function isGteMinVersion(version, minVersion) {
|
||||||
var versionMatch = /[a-z]?([0-9]*)/.exec(version);
|
var versionMatch = /[a-z]?([0-9]*)/.exec(version);
|
||||||
|
@ -56,13 +56,13 @@ class Logger {
|
|||||||
//
|
//
|
||||||
// See: https://github.com/trentm/node-bunyan/issues/37
|
// See: https://github.com/trentm/node-bunyan/issues/37
|
||||||
// See: https://github.com/trentm/node-bunyan/issues/73
|
// See: https://github.com/trentm/node-bunyan/issues/73
|
||||||
end () {
|
end (callback) {
|
||||||
// process.stdout cannot be closed
|
// process.stdout cannot be closed
|
||||||
if (!this.path) {
|
if (!this.path) {
|
||||||
return;
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.streams[0].stream.on('finish', resolve);
|
this.logger.streams[0].stream.on('finish', callback);
|
||||||
this.logger.streams[0].stream.end(); // close stream, flush buffer to disk
|
this.logger.streams[0].stream.end(); // close stream, flush buffer to disk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user