summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/cache/LocalCache.ts5
1 files changed, 4 insertions, 1 deletions
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<string, BaseEntityWithId> 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);
 	}