Add protection against immediate retries in delayGenerator

This commit is contained in:
Dan Stillman 2023-01-11 02:31:08 -05:00
parent 21777af980
commit 665473b108

View file

@ -860,7 +860,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);
}