Skip to content

Commit

Permalink
stability: remove all in-flight messages from the PQ on stop
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Jul 3, 2024
1 parent 5850549 commit 80bc415
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions beanstalkjobs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ func (d *Driver) Stop(ctx context.Context) error {
// release associated resources
d.pool.Stop()

// remove all pending JOBS associated with the pipeline
_ = d.pq.Remove(pipe.Name())

d.log.Debug("pipeline was stopped", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Int64("elapsed", time.Since(start).Milliseconds()))
return nil
}
Expand Down

0 comments on commit 80bc415

Please sign in to comment.