You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure your queue connection supports delay (so anything except sync)
Make a job that implements ShouldQueue
Dispatch the job with a delay like shown above
Watch the job get processed instantly without a delay
The text was updated successfully, but these errors were encountered:
SjorsO
changed the title
[10.x] Job delay doesn't work unless you use the Dispatchable trait
Job delay doesn't work unless you use the Dispatchable trait
Mar 24, 2023
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
I think this is pretty much expected behavior. You are bypassing the Bus which provides all of that stuff. You would need to use Queue::later if you want to hit the queue directly.
Description:
Delaying a job like this works:
But this doesn't work, it ignores the delay and instantly processes the job:
As far as I can tell, this happens because
Queue::push()
doesn't pass down the$job->delay
to theEnqueueUsing
method.Steps To Reproduce:
sync
)ShouldQueue
The text was updated successfully, but these errors were encountered: