1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 09:41:35 +02:00

fix: local cache

This commit is contained in:
Samuel 2023-03-18 05:11:14 +01:00
parent c6708f7443
commit f1f7e5ad7d

View File

@ -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);
}