ax(mining): replace prose RegisterTask comment with usage example
Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
248a413dae
commit
edcee49435
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue