Skip to content

Commit f8a289b

Browse files
fix: 尝试修复 OTEL 的问题
1 parent 45c892f commit f8a289b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bunx lint-staged
1+
npx lint-staged

src/utils/startupProfiler.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ export function profileReport(): void {
142142
logForDebugging('Startup profiling report:')
143143
logForDebugging(getReport())
144144
}
145+
146+
// Clear startup marks to prevent PerformanceMark accumulation in long-lived
147+
// processes (daemon, cron). After this point startup marks are no longer needed
148+
// — the report has been written and the Statsig event has been logged.
149+
const perf = getPerformance()
150+
perf.clearMarks()
151+
memorySnapshots.length = 0
145152
}
146153

147154
export function isDetailedProfilingEnabled(): boolean {

0 commit comments

Comments
 (0)