mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
fix: local cache
This commit is contained in:
parent
c6708f7443
commit
f1f7e5ad7d
5
src/util/cache/LocalCache.ts
vendored
5
src/util/cache/LocalCache.ts
vendored
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user