fix: to skip the operation maxRetries need to be calculated first
This commit is contained in:
parent
c67d0bff1d
commit
145714b335
@ -337,14 +337,6 @@ async function runTaskLoop(
|
|||||||
let minDue: AbsoluteTime = AbsoluteTime.never();
|
let minDue: AbsoluteTime = AbsoluteTime.never();
|
||||||
|
|
||||||
for (const p of pending.pendingOperations) {
|
for (const p of pending.pendingOperations) {
|
||||||
minDue = AbsoluteTime.min(minDue, p.timestampDue);
|
|
||||||
if (AbsoluteTime.isExpired(p.timestampDue)) {
|
|
||||||
numDue++;
|
|
||||||
}
|
|
||||||
if (p.givesLifeness) {
|
|
||||||
numGivingLiveness++;
|
|
||||||
}
|
|
||||||
|
|
||||||
const maxRetries = opts.maxRetries;
|
const maxRetries = opts.maxRetries;
|
||||||
|
|
||||||
if (maxRetries && p.retryInfo && p.retryInfo.retryCounter > maxRetries) {
|
if (maxRetries && p.retryInfo && p.retryInfo.retryCounter > maxRetries) {
|
||||||
@ -353,6 +345,15 @@ async function runTaskLoop(
|
|||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
minDue = AbsoluteTime.min(minDue, p.timestampDue);
|
||||||
|
if (AbsoluteTime.isExpired(p.timestampDue)) {
|
||||||
|
numDue++;
|
||||||
|
}
|
||||||
|
if (p.givesLifeness) {
|
||||||
|
numGivingLiveness++;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.stopWhenDone && numGivingLiveness === 0 && iteration !== 0) {
|
if (opts.stopWhenDone && numGivingLiveness === 0 && iteration !== 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user