Skip to content

Commit

Permalink
bad negation in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmchase committed Nov 13, 2024
1 parent 55e59b3 commit a9a1815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class MemoryCache {
refresh: () => Promise<T>,
ttl: number = 60000,
): Promise<T> {
if (!this.cache.has(key)) {
if (this.cache.has(key)) {
return this.cache.get(key)!.value as T;
} else {
const value = await refresh();
Expand Down

0 comments on commit a9a1815

Please sign in to comment.