Prevent retry fetching in another place

https://github.com/ajayyy/SponsorBlock/issues/667
This commit is contained in:
Ajay Ramachandran 2021-05-31 14:37:12 -04:00
parent a9a85d9816
commit 42fa6c44c4

View file

@ -621,7 +621,11 @@ async function sponsorsLookup(id: string) {
//TODO lower when server becomes better (back to 1 second)
//some error occurred, try again in a second
setTimeout(() => sponsorsLookup(id), 5000 + Math.random() * 15000 + 5000 * sponsorLookupRetries);
setTimeout(() => {
if (sponsorVideoID && sponsorTimes?.length === 0) {
sponsorsLookup(sponsorVideoID);
}
}, 5000 + Math.random() * 15000 + 5000 * sponsorLookupRetries);
sponsorLookupRetries++;
}