diff --git a/lib/monitoring/drift-health-monitor.ts b/lib/monitoring/drift-health-monitor.ts index 9ad9ff3..279dd82 100644 --- a/lib/monitoring/drift-health-monitor.ts +++ b/lib/monitoring/drift-health-monitor.ts @@ -10,8 +10,8 @@ import path from 'path' class DriftHealthMonitor { private errorCounts: Map = new Map() - private errorWindow: number = 30000 // 30 second window - private errorThreshold: number = 50 // 50 errors in 30 seconds = problem + private errorWindow: number = 10000 // 10 second window (was 30s - too slow for rapid memory leak) + private errorThreshold: number = 20 // 20 errors in 10 seconds = problem (was 50 in 30s) private checkInterval: NodeJS.Timeout | null = null private isMonitoring: boolean = false @@ -28,10 +28,10 @@ class DriftHealthMonitor { console.log('🏥 Drift health monitor started') console.log(` Threshold: ${this.errorThreshold} accountUnsubscribe errors in ${this.errorWindow/1000}s`) - // Check error counts every 10 seconds + // Check error counts every 3 seconds (was 10s - faster response to memory leak) this.checkInterval = setInterval(() => { this.checkErrorThreshold() - }, 10000) + }, 3000) } /**