Add expire time to cache keys
This commit is contained in:
parent
756138f8a0
commit
519e9ae5a2
@ -15,11 +15,7 @@ To get started go to <https://bs-overlay.fascinated.cc> and it is fairly self ex
|
|||||||
|
|
||||||
## Todo
|
## Todo
|
||||||
|
|
||||||
- Move caches to Redis
|
|
||||||
- Move media to my CDN server
|
|
||||||
- Cache BeatSaver data
|
- Cache BeatSaver data
|
||||||
- Add cache status in the response headers
|
|
||||||
- Move configuration files to ENV files
|
|
||||||
- Add toggle for showing pp
|
- Add toggle for showing pp
|
||||||
- Cleanup the API (or just re-do it)
|
- Cleanup the API (or just re-do it)
|
||||||
- Change the song time to a circular style in the song art
|
- Change the song time to a circular style in the song art
|
||||||
|
@ -9,7 +9,7 @@ const client = new Redis({
|
|||||||
client.connect().catch(() => {});
|
client.connect().catch(() => {});
|
||||||
|
|
||||||
async function setValue(key, value, expireAt = 86400) {
|
async function setValue(key, value, expireAt = 86400) {
|
||||||
await client.set(key, value);
|
await client.set(key, value, "EX", expireAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getValue(key) {
|
async function getValue(key) {
|
||||||
|
Reference in New Issue
Block a user