fixup! fixup! fixup! fixup! Weekend fun with further optimisations.

This commit is contained in:
2025-09-14 23:47:16 +01:00
parent f411273fa2
commit cc6d6693e0
93 changed files with 10178 additions and 37059 deletions
-15
View File
@@ -219,21 +219,6 @@ func (bt *BackgroundTask) run() {
}
}
// autoCleanupRoutine is a legacy function for running periodic cleanup tasks.
// Deprecated: Use BackgroundTask instead for better lifecycle management and logging.
func autoCleanupRoutine(interval time.Duration, stop <-chan struct{}, cleanup func()) {
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-ticker.C:
cleanup()
case <-stop:
return
}
}
}
// TaskCircuitBreaker implements circuit breaker pattern for background task creation
// It limits concurrent task execution and tracks failures to prevent system overload
type TaskCircuitBreaker struct {