Repository navigation
feat: [#949] make queue worker receive timeout configurable - #1568
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1568 +/- ##
==========================================
+ Coverage 72.84% 72.87% +0.03%
==========================================
Files 412 412
Lines 26846 26880 +34
==========================================
+ Hits 19556 19589 +33
- Misses 7288 7289 +1
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hwbrzzl
reviewed
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Receivecall by the per-connectionqueue.connections.<connection>.timeoutsetting, replacing the hardcoded 5-second receive deadline.json.Numberand duration strings such as"5s"; missing, non-positive, NaN or overflowing values fall back to the exportedDefaultReceiveTimeout(5s).Configcontract withTimeout(connection string) time.Duration, regeneratemocks/queue/Config.go, and ship"timeout": 5on the scaffolddatabaseconnection.Closes goravel/goravel#949
Why
The worker's receive loop used a hardcoded
5*time.Seconddeadline perReceivecall (with aTODO make the timeout configurable). Receive-based drivers such as Redis Streams or Kafka could not tune how long a single blocking receive may wait, so this change exposes a per-connectiontimeoutwhile keeping 5 seconds as the default.Set it in
config/queue.goalongside the other connection options; the scaffolddatabaseconnection now includes it as a starting point.Unlike the original PR #1553 description, this change does update public contracts:
Timeout(connection string) time.Durationis added tocontracts/queue/config.goandmocks/queue/Config.gois regenerated by mockery. It also fixes the compile failure from that PR, wherequeue/worker.goreferenced a non-existentr.queueNameinstead of the localqueueName, and a gofmt violation inqueue/config.go.