Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Fix job delay override + data_get() improvement to deal with closures #46591

Closed
wants to merge 8 commits into from

Conversation

bert-w
Copy link
Contributor

@bert-w bert-w commented Mar 25, 2023

Fix for #46568 and an improvement for #46505. Minor changes have been added for all queue drivers (Database, SQS, Redis, Beanstalkd) so a $delay property can be passed.

I would say this still is an issue on the basis of:

$job = new MyTestJob;
$job->delay(now()->addMinute());
Queue::push($job);

The code sample above should delay the job obviously (which before it didnt). Setting public $delay = 60; in some job class should now always make sure the job is delayed 60 seconds (unless you override it using Queue::later(30, new MyTestJob)) which imho is also expected behaviour.

Trace/Explanation: Everything goes through the Illuminate\Queue::enqueueUsing(...) which in turn calls the $callback which is its fifth argument. This callback differs per queue driver and has a $queue param.

@bert-w bert-w marked this pull request as ready for review March 25, 2023 15:17
@taylorotwell
Copy link
Member

We never document delaying queued jobs this way or say that it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants