Add protection against immediate retries in delayGenerator

This commit is contained in:
Dan Stillman 2023-01-11 02:31:08 -05:00
parent 6a1f0251cd
commit c7da16f07d

View file

@ -887,7 +887,14 @@ Zotero.Utilities.Internal = {
delay = interval;
}
// Be safe
if (!delay) {
Zotero.logError(`Incorrect delay ${delay} -- stopping`);
yield Zotero.Promise.resolve(false);
}
if (maxTime && (totalTime + delay) > maxTime) {
Zotero.debug(`Total delay time exceeds ${maxTime} -- stopping`);
yield Zotero.Promise.resolve(false);
}