mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-05 10:30:55 +01:00
Some tweaks to maybe make it work better
This commit is contained in:
parent
7707c0d2d0
commit
f49846d4c5
1 changed files with 7 additions and 4 deletions
11
src/fetch.ts
11
src/fetch.ts
|
@ -17,6 +17,10 @@ export const fetchUsingGuest = async (
|
|||
{
|
||||
method: 'POST',
|
||||
headers: tokenHeaders,
|
||||
cf: {
|
||||
cacheEverything: true,
|
||||
cacheTtl: 300
|
||||
},
|
||||
body: ''
|
||||
}
|
||||
);
|
||||
|
@ -27,7 +31,6 @@ export const fetchUsingGuest = async (
|
|||
`${Constants.TWITTER_API_ROOT}/1.1/guest/activate.json`,
|
||||
{
|
||||
method: 'GET',
|
||||
headers: tokenHeaders,
|
||||
cf: {
|
||||
cacheEverything: true,
|
||||
cacheTtl: 300
|
||||
|
@ -145,10 +148,10 @@ export const fetchUsingGuest = async (
|
|||
newTokenGenerated = true;
|
||||
continue;
|
||||
}
|
||||
console.log('Caching guest token');
|
||||
/* If we've generated a new token, we'll cache it */
|
||||
if (newTokenGenerated) {
|
||||
event && event.waitUntil(cache.put(guestTokenRequestCacheDummy, activate.clone()));
|
||||
if (event && newTokenGenerated) {
|
||||
console.log('Caching guest token');
|
||||
event.waitUntil(cache.put(guestTokenRequestCacheDummy, activate.clone()));
|
||||
}
|
||||
conversation.guestToken = guestToken;
|
||||
return conversation;
|
||||
|
|
Loading…
Add table
Reference in a new issue