From f8a289b8687bc87104c08e6b989587de0f2a6aa6 Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Mon, 4 May 2026 23:53:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=20O?= =?UTF-8?q?TEL=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 2 +- src/utils/startupProfiler.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index ea5a55b6f..2312dc587 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -bunx lint-staged +npx lint-staged diff --git a/src/utils/startupProfiler.ts b/src/utils/startupProfiler.ts index d16b094a8..2e8f9f2b4 100644 --- a/src/utils/startupProfiler.ts +++ b/src/utils/startupProfiler.ts @@ -142,6 +142,13 @@ export function profileReport(): void { logForDebugging('Startup profiling report:') logForDebugging(getReport()) } + + // Clear startup marks to prevent PerformanceMark accumulation in long-lived + // processes (daemon, cron). After this point startup marks are no longer needed + // — the report has been written and the Statsig event has been logged. + const perf = getPerformance() + perf.clearMarks() + memorySnapshots.length = 0 } export function isDetailedProfilingEnabled(): boolean {