Skip to content

Commit

Permalink
Remove context deadline
Browse files Browse the repository at this point in the history
Quick fix. We use the heartbeat middlewear which allows long-running
jobs to work. However, the context is also ending up canceled which is
causing other issues.
  • Loading branch information
jpalawaga committed Nov 10, 2022
1 parent 2d5297f commit 414947a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func (w *Worker) RunOnce(ctx context.Context, queueID string, h ContextHandleFun
}

handle := func(job *Job, o *DequeueOptions) error {
ctx, cancel := context.WithTimeout(ctx, opt.MaxExecutionTime)
defer cancel()
//ctx, cancel := context.WithTimeout(ctx, opt.MaxExecutionTime)
//defer cancel()
return h(ctx, job, o)
}
for _, mw := range opt.HandleMiddleware {
Expand Down

0 comments on commit 414947a

Please sign in to comment.