diff --git a/pkg/mining/supervisor.go b/pkg/mining/supervisor.go index b5eddc9..1cb274c 100644 --- a/pkg/mining/supervisor.go +++ b/pkg/mining/supervisor.go @@ -44,8 +44,8 @@ func NewTaskSupervisor() *TaskSupervisor { } } -// RegisterTask registers a task for supervision. -// The task will be automatically restarted if it exits or panics. +// supervisor.RegisterTask("stats-collector", collectStats, 5*time.Second, -1) +// supervisor.RegisterTask("cleanup", runCleanup, 30*time.Second, 10) func (s *TaskSupervisor) RegisterTask(name string, task TaskFunc, restartDelay time.Duration, maxRestarts int) { s.mu.Lock() defer s.mu.Unlock()