fix(event): prune synthetic idle dedup map

This commit is contained in:
YeonGyu-Kim
2026-02-10 14:08:02 +09:00
parent 61531ca26c
commit 97b7215848
3 changed files with 44 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
export function pruneRecentSyntheticIdles(args: {
recentSyntheticIdles: Map<string, number>
now: number
dedupWindowMs: number
}): void {
const { recentSyntheticIdles, now, dedupWindowMs } = args
for (const [sessionID, emittedAt] of recentSyntheticIdles) {
if (now - emittedAt >= dedupWindowMs) {
recentSyntheticIdles.delete(sessionID)
}
}
}