File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export async function getFreshAccessToken(
118
118
return newToken . accessToken ;
119
119
}
120
120
121
- export async function updateToken (
121
+ export async function updateProviderKey (
122
122
config : Config ,
123
123
accessToken : string ,
124
124
providerKey : string ,
@@ -129,13 +129,16 @@ export async function updateToken(
129
129
'Tried getting token from cache while cache was undefined.' ,
130
130
) ;
131
131
}
132
+
132
133
const newToken = { accessToken, isPending : false } ;
133
134
await tokenCache . set ( providerKey , newToken , getTokenCacheTtl ( ) ) ;
134
135
const { PUBSUB_TOPIC_NAME_UPDATE_PROVIDER_KEY } = process . env ;
136
+
135
137
assert (
136
138
PUBSUB_TOPIC_NAME_UPDATE_PROVIDER_KEY ,
137
139
'PUBSUB_TOPIC_NAME_UPDATE_PROVIDER_KEY is not defined' ,
138
140
) ;
141
+
139
142
const pubSubClient = new PubSubClient ( PUBSUB_TOPIC_NAME_UPDATE_PROVIDER_KEY ) ;
140
143
await pubSubClient . publishMessage ( {
141
144
userID : config . userId ,
You can’t perform that action at this time.
0 commit comments