From 5f696176b444e8836dcc09c08a59b3edf7690bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 27 Jul 2025 10:35:17 -0400 Subject: [PATCH] fix: clearTimeout if item is evicted from cache --- src/activitypub/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 4067405080..926f8d0754 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -346,7 +346,16 @@ ActivityPub.get = async (type, id, uri, options) => { } }; -ActivityPub.retryQueue = lru({ name: 'activitypub-retry-queue', max: 4000, ttl: 1000 * 60 * 60 * 24 * 60 }); +ActivityPub.retryQueue = lru({ + name: 'activitypub-retry-queue', + max: 4000, + ttl: 1000 * 60 * 60 * 24 * 60, + dispose: (value) => { + if (value) { + clearTimeout(value); + } + }, +}); // handle clearing retry queue from another member of the cluster pubsub.on(`activitypub-retry-queue:lruCache:del`, (keys) => {