From c391aede1f85686e0469cfe5570680fbe5e04307 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Thu, 2 Jan 2025 20:46:11 +0000 Subject: [PATCH] Refactor sync history --- plugin/src/tracing/sync-history.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/src/tracing/sync-history.ts b/plugin/src/tracing/sync-history.ts index 2c4e4514..aca45668 100644 --- a/plugin/src/tracing/sync-history.ts +++ b/plugin/src/tracing/sync-history.ts @@ -36,10 +36,12 @@ export interface HistoryStats { export class SyncHistory { private static readonly MAX_ENTRIES = 1000; - private entries: HistoryEntry[] = []; + private readonly entries: HistoryEntry[] = []; + private readonly syncHistoryUpdateListeners: (( status: HistoryStats ) => void)[] = []; + private status: HistoryStats = { success: 0, error: 0, @@ -50,7 +52,7 @@ export class SyncHistory { } public reset(): void { - this.entries = []; + this.entries.length = 0; this.status = { success: 0, error: 0,