File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,11 @@ if (config.redis?.enabled) {
154
154
155
155
activeRequestPromises [ key as string ] = request ;
156
156
157
- void request . finally ( ( ) => delete activeRequestPromises [ key as string ] ) ;
157
+ void request . finally ( ( ) => {
158
+ delete activeRequestPromises [ key as string ] ;
159
+
160
+ resetKeys . delete ( key ) ;
161
+ } ) ;
158
162
159
163
return request ;
160
164
} ;
@@ -202,11 +206,12 @@ if (config.redis?.enabled) {
202
206
203
207
const ttl = client . ttl . bind ( client ) ;
204
208
exportClient . ttl = async ( key ) => {
205
- if ( cache && cacheClient && ttlCache . has ( key ) ) {
209
+ const ttlResult = cache && cacheClient && ttlCache . get ( key ) ;
210
+ if ( ttlResult != null ) {
206
211
// Trigger usage of cache
207
212
cache . get ( key ) ;
208
213
209
- return ttlCache . get ( key ) + config . redis ?. expiryTime - Math . floor ( Date . now ( ) / 1000 ) ;
214
+ return ttlResult + config . redis ?. expiryTime - Math . floor ( Date . now ( ) / 1000 ) ;
210
215
} else {
211
216
const result = await ttl ( createKeyName ( key ) ) ;
212
217
if ( ttlCache ) ttlCache . set ( key , Math . floor ( Date . now ( ) / 1000 ) - ( config . redis ?. expiryTime - result ) ) ;
You can’t perform that action at this time.
0 commit comments