Ensure tunnel stops when jobs are completed.

This commit is contained in:
John-David Dalton
2014-05-14 22:58:46 -07:00
parent 7152308c25
commit ce3c78d30b

View File

@@ -681,8 +681,7 @@ function Tunnel(properties) {
success = !this.failed;
}
if (++completed == total) {
tunnel.running = false;
tunnel.emit('complete', success);
tunnel.stop(_.partial(tunnel.emit, 'complete', success));
return;
}
tunnel.dequeue();
@@ -874,7 +873,7 @@ var tunnel = new Tunnel({
});
tunnel.on('complete', function(success) {
this.stop(function() { process.exit(success ? 0 : 1); });
process.exit(success ? 0 : 1);
});
tunnel.start();