Stopped batch service when draining

This commit is contained in:
Daniel García Aubert 2016-01-25 15:32:00 +01:00
parent 20fd536659
commit 1e49fbc33d

View File

@ -19,6 +19,7 @@ Batch.prototype.start = function () {
this._subscribe(); this._subscribe();
process.on('SIGTERM', function () { process.on('SIGTERM', function () {
self.stop();
self.drain(function (err) { self.drain(function (err) {
if (err) { if (err) {
console.log('Exit with error'); console.log('Exit with error');