Stop action when picking up the job

This commit is contained in:
mudler
2024-04-21 15:39:38 +02:00
parent 1fc0db18cd
commit 773259ceaa
3 changed files with 7 additions and 3 deletions

View File

@@ -14,7 +14,9 @@ type ActionContext struct {
}
func (ac *ActionContext) Cancel() {
ac.cancelFunc()
if ac.cancelFunc == nil {
ac.cancelFunc()
}
}
func NewContext(ctx context.Context, cancel context.CancelFunc) *ActionContext {