From 519e9ae5a2e62b8e9f43f9ac2227756396fa40aa Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Thu, 20 Oct 2022 18:10:23 +0100 Subject: [PATCH] Add expire time to cache keys --- README.md | 4 ---- src/utils/redisUtils.js | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index dc1c98d..eb94712 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,7 @@ To get started go to and it is fairly self ex ## Todo -- Move caches to Redis -- Move media to my CDN server - Cache BeatSaver data -- Add cache status in the response headers -- Move configuration files to ENV files - Add toggle for showing pp - Cleanup the API (or just re-do it) - Change the song time to a circular style in the song art diff --git a/src/utils/redisUtils.js b/src/utils/redisUtils.js index 150f7e1..512d3d3 100644 --- a/src/utils/redisUtils.js +++ b/src/utils/redisUtils.js @@ -9,7 +9,7 @@ const client = new Redis({ client.connect().catch(() => {}); async function setValue(key, value, expireAt = 86400) { - await client.set(key, value); + await client.set(key, value, "EX", expireAt); } async function getValue(key) {