diff --git a/CHANGELOG.md b/CHANGELOG.md index 2478a398..0e1e15aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Client no longer returns an error if stopped before startup could complete (previously, it returned the unexported `ErrShutdown`). [PR #841](https://github.com/riverqueue/river/pull/841). +### Fixed + +- A queue unpausing triggers an immediate fetch so that available jobs in the paused queue may be started faster than before. [PR #854](https://github.com/riverqueue/river/pull/854). + ## [0.20.2] - 2025-04-08 ### Added diff --git a/producer.go b/producer.go index 2ead83d7..7cc79c76 100644 --- a/producer.go +++ b/producer.go @@ -535,6 +535,7 @@ func (p *producer) fetchAndRunLoop(fetchCtx, workCtx context.Context, fetchLimit } p.paused = false p.Logger.DebugContext(workCtx, p.Name+": Resumed", slog.String("queue", p.config.Queue), slog.String("queue_in_message", msg.Queue)) + fetchLimiter.Call() // try another fetch because more jobs may be available to run which were gated behind the paused queue p.testSignals.Resumed.Signal(struct{}{}) if p.config.QueueEventCallback != nil { p.config.QueueEventCallback(&Event{Kind: EventKindQueueResumed, Queue: &rivertype.Queue{Name: p.config.Queue}})