From 59a92d03638ac0bf48e31a4b125b9eb2cc28b20b Mon Sep 17 00:00:00 2001 From: TKone7 Date: Mon, 23 Oct 2023 15:49:34 +0200 Subject: [PATCH] Fix cleanup logic Keep only cache entries with an expiry in the future. --- backend/src/api/memory-cache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/api/memory-cache.ts b/backend/src/api/memory-cache.ts index fe4162420..e71aaa6a2 100644 --- a/backend/src/api/memory-cache.ts +++ b/backend/src/api/memory-cache.ts @@ -31,7 +31,7 @@ class MemoryCache { } private cleanup() { - this.cache = this.cache.filter((cache) => cache.expires < (new Date())); + this.cache = this.cache.filter((cache) => cache.expires > (new Date())); } }