Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
9aa7097eef | |||
55904642d0 |
@ -88,7 +88,7 @@ func (this *Manager) Run (ctx context.Context) error {
|
|||||||
waitGroup.Wait()
|
waitGroup.Wait()
|
||||||
|
|
||||||
done()
|
done()
|
||||||
return nil
|
return ctx.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append adds one or more routines to the Routines slice. This has no effect if
|
// Append adds one or more routines to the Routines slice. This has no effect if
|
||||||
@ -134,7 +134,7 @@ func (this *Manager) runRoutine (routine Routine, group *sync.WaitGroup) {
|
|||||||
err := panicWrap(routine.Run, this.ctx)
|
err := panicWrap(routine.Run, this.ctx)
|
||||||
|
|
||||||
if ctxErr := this.ctx.Err(); ctxErr != nil {
|
if ctxErr := this.ctx.Err(); ctxErr != nil {
|
||||||
if err == nil {
|
if err == nil || errors.Is(err, context.Canceled) {
|
||||||
this.log("(i) stopped routine")
|
this.log("(i) stopped routine")
|
||||||
} else {
|
} else {
|
||||||
this.log("!!! stopped routine, with error:", err)
|
this.log("!!! stopped routine, with error:", err)
|
||||||
@ -148,8 +148,8 @@ func (this *Manager) runRoutine (routine Routine, group *sync.WaitGroup) {
|
|||||||
} else {
|
} else {
|
||||||
this.log("XXX routine failed:", err)
|
this.log("XXX routine failed:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(lastStart) < this.RestartDeadline {
|
if time.Since(lastStart) < restartDeadline {
|
||||||
this.log("!!! not restarting routine, failed too soon")
|
this.log("!!! not restarting routine, failed too soon")
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user