From 003c377edda2d549c6af18e441e6323e98c4f4bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:36:36 +0000 Subject: [PATCH 1/3] Initial plan From dbe38183eb2c72ffd44391ac2a59428ed1e89b59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:40:02 +0000 Subject: [PATCH 2/3] Decrease memoization TTL by 50% and set cache cleanup interval to 30s Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> --- workers/grouper/src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workers/grouper/src/index.ts b/workers/grouper/src/index.ts index 998142fe..bb905597 100644 --- a/workers/grouper/src/index.ts +++ b/workers/grouper/src/index.ts @@ -36,12 +36,12 @@ import { memoize } from '../../../lib/memoize'; * eslint does not count decorators as a variable usage */ /* eslint-disable-next-line no-unused-vars */ -const MEMOIZATION_TTL = 600_000; +const MEMOIZATION_TTL = 300_000; /** - * Cache cleanup interval in minutes + * Cache cleanup interval in seconds */ -const CACHE_CLEANUP_INTERVAL_MINUTES = 5; +const CACHE_CLEANUP_INTERVAL_SECONDS = 30; /** * Error code of MongoDB key duplication error @@ -103,11 +103,11 @@ export default class GrouperWorker extends Worker { /** * Start periodic cache cleanup to prevent memory leaks from unbounded cache growth - * Runs every 5 minutes to clear old cache entries + * Runs every 30 seconds to clear old cache entries */ this.cacheCleanupInterval = setInterval(() => { this.clearCache(); - }, CACHE_CLEANUP_INTERVAL_MINUTES * TimeMs.MINUTE); + }, CACHE_CLEANUP_INTERVAL_SECONDS * TimeMs.SECOND); await super.start(); } From 590749e5e7b787a74f15476212c27b0ff918c290 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:43:56 +0000 Subject: [PATCH 3/3] Decrease MEMOIZATION_TTL to 1 minute (60_000 ms) Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> --- workers/grouper/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workers/grouper/src/index.ts b/workers/grouper/src/index.ts index bb905597..f016c850 100644 --- a/workers/grouper/src/index.ts +++ b/workers/grouper/src/index.ts @@ -36,7 +36,7 @@ import { memoize } from '../../../lib/memoize'; * eslint does not count decorators as a variable usage */ /* eslint-disable-next-line no-unused-vars */ -const MEMOIZATION_TTL = 300_000; +const MEMOIZATION_TTL = 60_000; /** * Cache cleanup interval in seconds