Add protection against immediate retries in delayGenerator
This commit is contained in:
parent
21777af980
commit
665473b108
1 changed files with 7 additions and 0 deletions
|
@ -860,7 +860,14 @@ Zotero.Utilities.Internal = {
|
||||||
delay = interval;
|
delay = interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Be safe
|
||||||
|
if (!delay) {
|
||||||
|
Zotero.logError(`Incorrect delay ${delay} -- stopping`);
|
||||||
|
yield Zotero.Promise.resolve(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (maxTime && (totalTime + delay) > maxTime) {
|
if (maxTime && (totalTime + delay) > maxTime) {
|
||||||
|
Zotero.debug(`Total delay time exceeds ${maxTime} -- stopping`);
|
||||||
yield Zotero.Promise.resolve(false);
|
yield Zotero.Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue