mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Make threshold account for job batch sizes smaller than the throttled amount.
This commit is contained in:
@@ -647,7 +647,7 @@ function Tunnel(properties) {
|
|||||||
restarted.push(this);
|
restarted.push(this);
|
||||||
}
|
}
|
||||||
// restart tunnel if all active jobs have restarted
|
// restart tunnel if all active jobs have restarted
|
||||||
var threshold = _.isFinite(throttled) ? throttled : 3;
|
var threshold = Math.min(all.length, _.isFinite(throttled) ? throttled : 3);
|
||||||
if (active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
|
if (active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
|
||||||
tunnel.restart();
|
tunnel.restart();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user