summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/cache.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-01 17:25:52 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-06-01 17:25:52 +0000
commite1504cfb88d047acbfc5c08bcf790c0a08875ee9 (patch)
tree074df46515fd4ddd4a6bdf7b0a1af57fcb663291 /packages/backend/src/misc/cache.ts
parentmerge: fix DeepLX (!1077) (diff)
parentexclude local notes from bubble timeline (diff)
downloadsharkey-e1504cfb88d047acbfc5c08bcf790c0a08875ee9.tar.gz
sharkey-e1504cfb88d047acbfc5c08bcf790c0a08875ee9.tar.bz2
sharkey-e1504cfb88d047acbfc5c08bcf790c0a08875ee9.zip
merge: Persisted instance blocks (!1068)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1068 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/misc/cache.ts')
-rw-r--r--packages/backend/src/misc/cache.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts
index 48b8f43678..a6ab96c189 100644
--- a/packages/backend/src/misc/cache.ts
+++ b/packages/backend/src/misc/cache.ts
@@ -308,8 +308,17 @@ export class MemoryKVCache<T> {
}
}
+ /**
+ * Removes all entries from the cache, but does not dispose it.
+ */
+ @bindThis
+ public clear(): void {
+ this.cache.clear();
+ }
+
@bindThis
public dispose(): void {
+ this.clear();
clearInterval(this.gcIntervalHandle);
}