Skip to content

Commit 252e230

Browse files
committed
Fix undefined redis timeout breaking redis
1 parent 9c72e20 commit 252e230

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/redis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ if (config.redis?.enabled) {
3333

3434
const get = client.get.bind(client);
3535
exportClient.get = (key) => new Promise((resolve, reject) => {
36-
const timeout = setTimeout(() => reject(), config.redis.getTimeout);
36+
const timeout = config.redis.getTimeout ? setTimeout(() => reject(), config.redis.getTimeout) : null;
3737
get(key).then((reply) => {
38-
clearTimeout(timeout);
38+
if (timeout !== null) clearTimeout(timeout);
3939
resolve(reply);
4040
}).catch((err) => reject(err));
4141
});

0 commit comments

Comments
 (0)