Reputation: 180
I am building a large application using Laravel and find the use of queue in this application. I am now using beanstalkd service for this. However, I am stuck in finding an answer for this set up. Is there a way to put the queue retries be processed in not instantly manner. I wanted it to be retried after n seconds. Thanks
Upvotes: 4
Views: 11201
Reputation: 159
In the queue:work command --delay option is deprecated.
You have to use --backoff
--backoff[=BACKOFF] The number of seconds to wait before retrying a job that encountered an uncaught exception [default: "0"]
Upvotes: 2
Reputation: 3809
To delay the next retry just add --delay=[NUM_OF_SECONDS]
to your command.
For example, to wait 30 seconds to retry after failing just run: php artisan queue:work tries=3 --delay=30
Upvotes: 1
Reputation: 6319
Try using the inbuilt Queue
service and use the following
Queue::later(Carbon::now()->addMinutes(1), $task);
Upvotes: 2