From 09acb021eb3635ffca8944eb660c0a746f73f572 Mon Sep 17 00:00:00 2001 From: Chaim Marcus Date: Sat, 16 May 2026 17:41:43 +0000 Subject: [PATCH] perf: hoist companies.list() outside stale-case loop --- src/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.ts b/src/worker.ts index e97266a..6aefea2 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -723,8 +723,8 @@ const plugin = definePlugin({ }; let reminded = 0; + const companies = await ctx.companies.list(); for (const staleCase of data.cases) { - const companies = await ctx.companies.list(); for (const company of companies) { const issues = await ctx.issues.list({ companyId: company.id }); let linkedIssueId: string | null = null;