From f1f7e5ad7d7f197cd741f248011cc45636a0f434 Mon Sep 17 00:00:00 2001 From: Samuel <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 18 Mar 2023 05:11:14 +0100 Subject: fix: local cache --- src/util/cache/LocalCache.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/cache/LocalCache.ts b/src/util/cache/LocalCache.ts index 547899ac..9c4f23b3 100644 --- a/src/util/cache/LocalCache.ts +++ b/src/util/cache/LocalCache.ts @@ -38,8 +38,11 @@ export class LocalCache extends Map implements Cache { } set(key: string, value: BaseEntityWithId): this { + if (this.has(key)) { + this.update(key, value); + return this; + } this.last_access.set(key, Date.now()); - if (this.has(key)) this.update(key, value); return super.set(key, value as never); } -- cgit 1.4.1