mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Ensure tunnel stops when jobs are completed.
This commit is contained in:
@@ -681,8 +681,7 @@ function Tunnel(properties) {
|
|||||||
success = !this.failed;
|
success = !this.failed;
|
||||||
}
|
}
|
||||||
if (++completed == total) {
|
if (++completed == total) {
|
||||||
tunnel.running = false;
|
tunnel.stop(_.partial(tunnel.emit, 'complete', success));
|
||||||
tunnel.emit('complete', success);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tunnel.dequeue();
|
tunnel.dequeue();
|
||||||
@@ -874,7 +873,7 @@ var tunnel = new Tunnel({
|
|||||||
});
|
});
|
||||||
|
|
||||||
tunnel.on('complete', function(success) {
|
tunnel.on('complete', function(success) {
|
||||||
this.stop(function() { process.exit(success ? 0 : 1); });
|
process.exit(success ? 0 : 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
tunnel.start();
|
tunnel.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user