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

[5.8] Job Based Retry Delay #28265

Merged
merged 3 commits into from Apr 18, 2019

Conversation

Projects
None yet
1 participant
@taylorotwell
Copy link
Member

commented Apr 18, 2019

This PR implements support for job based retry delays. Previously, this was only determined at a worker level via the --delay option on the worker command. However, sometimes jobs need to have different failure retry rates for various reasons, such as third-party API limits, etc. This is also in line with allowing job based maximum retries and timeout values.

This should allow queued jobs to determine their own retry delay when necessary. This may be done using a simple retryAfter property (integer - seconds) on the job class.

public $retryAfter = 10;

Or, you may define a retryAfter method if more complex logic is required to determine the retry delay. The method may return an integer or a DateTime. If a timestamp is returned, the seconds until that DateTime is used as the delay (e.g. return now()->addSeconds(5) to delay 5 seconds).

Closes laravel/ideas#537

taylorotwell added some commits Apr 18, 2019

@taylorotwell taylorotwell merged commit 95ea42b into 5.8 Apr 18, 2019

4 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/styleci/push The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@taylorotwell taylorotwell deleted the job-delay branch Apr 18, 2019

@GrahamCampbell GrahamCampbell changed the title Job Based Retry Delay [5.8] Job Based Retry Delay Apr 19, 2019

DarkGhostHunter added a commit to DarkGhostHunter/docs that referenced this pull request Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.