Fixed guest token purging

This commit is contained in:
dangered wolf 2022-08-18 16:53:06 -04:00
parent 6b4ab57f17
commit ad932839c6
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -123,7 +123,7 @@ export const fetchUsingGuest = async (
/* We'll usually only hit this if we get an invalid response from Twitter.
It's uncommon, but it happens */
console.error('Unknown error while fetching conversation from API');
event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy));
event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy.clone()));
newTokenGenerated = true;
continue;
}
@ -135,7 +135,7 @@ export const fetchUsingGuest = async (
/* Running out of requests within our rate limit, let's purge the cache */
if (remainingRateLimit < 20) {
console.log(`Purging token on this edge due to low rate limit remaining`);
event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy));
event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy.clone()));
}
if (