Skip to content

Commit

Permalink
fix: redis store after types were fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
psteinroe committed Nov 20, 2024
1 parent 358e3f8 commit 09c7769
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/postgrest-server/src/stores/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@ export class RedisStore implements Store {
}

public async get<Result>(key: string): Promise<Entry<Result> | undefined> {
let value: Entry<Result> | undefined;
try {
const res = await this.redis.get(this.buildCacheKey(key));
value = JSON.parse(res) as Entry<Result>;
} catch {
//
}

return value;
const res = await this.redis.get(this.buildCacheKey(key));
if (!res) return;

return JSON.parse(res) as Entry<Result>;
}

public async set<Result>(key: string, entry: Entry<Result>): Promise<void> {
Expand Down

0 comments on commit 09c7769

Please sign in to comment.