Restart tunnel if all *active* jobs have restarted.

This commit is contained in:
John-David Dalton
2014-05-03 22:09:15 -07:00
parent 702a82bb38
commit 6ad31a5441

View File

@@ -646,8 +646,9 @@ function Tunnel(properties) {
if (!_.contains(restarted, this)) {
restarted.push(this);
}
// restart tunnel if all jobs have restarted
if (_.isEmpty(_.difference(all, restarted))) {
// restart tunnel if all active jobs have restarted
var threshold = _.isFinite(throttled) ? throttled : 3;
if (active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
tunnel.restart();
}
});