diff --git a/packages/postgrest-server/src/stores/redis.ts b/packages/postgrest-server/src/stores/redis.ts index 0aded786..3d9b9f1e 100644 --- a/packages/postgrest-server/src/stores/redis.ts +++ b/packages/postgrest-server/src/stores/redis.ts @@ -23,15 +23,10 @@ export class RedisStore implements Store { } public async get(key: string): Promise | undefined> { - let value: Entry | undefined; - try { - const res = await this.redis.get(this.buildCacheKey(key)); - value = JSON.parse(res) as Entry; - } catch { - // - } - - return value; + const res = await this.redis.get(this.buildCacheKey(key)); + if (!res) return; + + return JSON.parse(res) as Entry; } public async set(key: string, entry: Entry): Promise {