Repository navigation
Conversation
Resolves goravel/goravel#949: the 5s timeout on each blocking Receive call in the worker (flagged in PR goravel#1435 review) is now read from queue.connections.<connection>.timeout (seconds, default 5). Co-Authored-By: Claude Code <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1553 +/- ##
==========================================
+ Coverage 72.69% 72.71% +0.01%
==========================================
Files 412 412
Lines 26772 26788 +16
==========================================
+ Hits 19462 19478 +16
Misses 7308 7308
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The |
🤖 Automated reviewThis is an AI-generated code review. Please double-check each finding before acting. SummaryAdds a per-connection Verdict
FindingsShould Fix
Nits
Automated Checks
|
…ard, deadline tests - Add Timeout(connection) time.Duration to contracts/queue Config and implement it in queue/config.go: int/int64/float64 seconds, duration strings via time.ParseDuration, non-positive/missing/garbage fall back to the 5s default (moved defaultReceiveTimeout here). - NewWorker now uses config.Timeout(connection); rename worker field timeout -> receiveTimeout. - Regenerate mocks/queue/Config.go with go tool mockery. - Tests: Timeout() boundary table in config_test.go; runWithReceive deadline subtests asserting ctx.Deadline() ~ now + receiveTimeout for default and custom values. Deliberately skipped review nits: per-worker timeout override and queue.php scaffold config key (out of scope for this PR).
|
Addressed the automated review (all 3 Should-Fix + 2 nits) in ba5073c:
|
|
@copilot resolve the merge conflicts in this pull request |
|
Hey @wafik I solved the failed CI in another PR, and it had been merged. I'll close this PR, and thanks so much for your contribution. |
Problem
runWithReceivehardcoded a 5-second timeout on each blockingReceivecall, with a// TODO make the timeout configurableleft in the code (goravel/goravel#949 quotes the original review note from #1435).Approach
Per-connection config key
queue.connections.<connection>.timeout(integer seconds, default5), matching the existing per-connection style ofconcurrent/retry_after:Workergains atimeoutfield resolved once inNewWorker.runWithReceiveuses it instead of the hardcoded5*time.Second.Extending timeouts to
Pop/Pushwas explicitly deferred to a future issue in the original comment, so theDriverinterface is untouched here.Testing
go build ./...go test ./queue/... -count=1— 189 passedtimeoutconfig value reaches the worker;TestNewWorkerhappy path covers the default.