perf: hoist companies.list() outside stale-case loop

This commit is contained in:
2026-05-16 17:41:43 +00:00
parent 06679bb061
commit 09acb021eb

View File

@@ -723,8 +723,8 @@ const plugin = definePlugin({
}; };
let reminded = 0; let reminded = 0;
const companies = await ctx.companies.list();
for (const staleCase of data.cases) { for (const staleCase of data.cases) {
const companies = await ctx.companies.list();
for (const company of companies) { for (const company of companies) {
const issues = await ctx.issues.list({ companyId: company.id }); const issues = await ctx.issues.list({ companyId: company.id });
let linkedIssueId: string | null = null; let linkedIssueId: string | null = null;