Skip to content

Commit

Permalink
✂️
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Oct 22, 2024
1 parent 9a560e4 commit 4467dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/src/shared/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function cacheWithRedis<T, Args extends unknown[]>(
});
let cacheVal = await redisCli.get(key);
if (cacheVal) {
return await (JSON.parse(cacheVal) as Promise<JsonSerializable<T>>);
return JSON.parse(cacheVal) as JsonSerializable<T>;
}

// specific try-finally to ensure unlock is called only after lock
Expand All @@ -80,7 +80,7 @@ export function cacheWithRedis<T, Args extends unknown[]>(
await lock(key);
cacheVal = await redisCli.get(key);
if (cacheVal) {
return await (JSON.parse(cacheVal) as Promise<JsonSerializable<T>>);
return JSON.parse(cacheVal) as JsonSerializable<T>;
}
}

Expand Down

0 comments on commit 4467dd7

Please sign in to comment.