Spaces:
Paused
Paused
|
Download docs/archive/SETINTERVAL_BUG_VERIFIED.md from Kraft102/widgettdc-api: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/spaces/Kraft102/widgettdc-api/resolve/main/docs/archive/SETINTERVAL_BUG_VERIFIED.md
- Command line
-
hf download hf://spaces/Kraft102/widgettdc-api/docs/archive/SETINTERVAL_BUG_VERIFIED.md
-
curl -L -o SETINTERVAL_BUG_VERIFIED.md https://huggingface.co/spaces/Kraft102/widgettdc-api/resolve/main/docs/archive/SETINTERVAL_BUG_VERIFIED.md
1.53 kB
β setInterval Resource Leak Bug - VERIFIED FIXED
Date: 2025-11-24
Status: β
ALREADY FIXED
π Bug Description
The setInterval started in the AutonomousTaskEngine constructor was not stored and could not be cleared, causing a resource leak. Even after calling stop(), the interval continued running indefinitely.
β Verification
Location: apps/backend/src/mcp/cognitive/AutonomousTaskEngine.ts
Line 69: β Property added to store interval ID
private memoryOptimizationIntervalId: NodeJS.Timeout | null = null;
Line 91: β Interval ID is stored when created
this.memoryOptimizationIntervalId = setInterval(() => {
this.queue.enqueue({
type: 'memory_optimization',
payload: { mode: 'nightly_consolidation' },
baseScore: 80,
isMaintenanceTask: true
}, 80);
}, 1000 * 60 * 60 * 24);
Lines 128-133: β
Interval is cleared in stop() method
stop() {
this.active = false;
// Clear the memory optimization interval to prevent resource leak
if (this.memoryOptimizationIntervalId !== null) {
clearInterval(this.memoryOptimizationIntervalId);
this.memoryOptimizationIntervalId = null;
}
}
β Conclusion
Status: β BUG IS ALREADY FIXED
The code correctly:
- Stores the interval ID in a class property
- Clears the interval when
stop()is called - Prevents resource leaks
No further action needed for this bug.