Repository navigation
Fix #34: Return refused message to the queue and stop handling - #35
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #35 +/- ##
=============================================
+ Coverage 21.78% 84.21% +62.42%
- Complexity 30 32 +2
=============================================
Files 1 1
Lines 101 114 +13
=============================================
+ Hits 22 96 +74
+ Misses 79 18 -61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AdapterRunTest uses an SQLite database, and the Windows PHP builds do not load pdo_sqlite by default.
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.
Fixes #34.
When the handler callback returned
false, for example becausequeue:run --limitwas reached, the adapter kept the message reserved and continued with the next ones. Those messages stayed locked untilttrexpired, and their attempt counters went up although they were never handled.Now, on
false, the adapter returns the message to the queue and stops:reserved_atis cleared and the attempt counter is restored to its value before the reservation.reserved_at, so a message whose reservation already expired and was taken again is left alone.This relies on
falsemeaning "not processed", which yiisoft/queue#349 establishes, so it should be merged after that PR. Without it, the currentQueueConsumerreturnsfalseafter processing a message when the loop stops, and that message would be returned to the queue and processed again.The package also has to work with the current yiisoft/queue first: since yiisoft/queue#321 it cannot be loaded against yiisoft/queue master, because
Provider\QueueProviderInterfacewas removed. That is fixed in #36, which should be merged before this one.