From 09c7769d1c3246b213b04e5081f0bf7775a988b2 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Wed, 20 Nov 2024 17:13:44 +0100 Subject: [PATCH] fix: redis store after types were fixed --- packages/postgrest-server/src/stores/redis.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 {