Replies: 1 comment
-
Yup, same issue... turns out it's expected behaviour |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
ShouldBeUnique
on Jobs in a project and noticed that duplicate jobs are still being queued. On investigation it appears thatShouldBeUnique
only works if you dispatch a job in certain ways.I have put together a test to prove the various behaviours of
ShouldBeUnique
liamkeily/laravel-queue-behaviour@ff34c3e#diff-88de2e685736b4d69dd9ac122767ca9580e3feb74cc821bc1f109accb2ea9017To summarise:
dispatch
helper works correctly and prevents duplicate jobsBus::dispatch
ignores it and allows duplicate jobsBus::batch
ignores it and allows duplicate jobsBus::chain
removes duplicates in an individual chain, but allows another chain to add duplicatesI'm not sure if this is considered a bug or expected behaviour, but it seems confusing so opening as a discussion for thoughts.
Beta Was this translation helpful? Give feedback.
All reactions