Have a Laravel 5.7 app with a single Job class. The job itself will fetch data and process it.
The amount of data (and therefore the length of time the job takes) can vary massively so wanted to have a dynamic timeout based on the runtime of the past n jobs (the details are stored so can be queried).
This would work in that I can set public $timeout = n
in the class but the retry_after
value can only be set on CLI or in the config/queue.php
as the public $retryAfter
in the class has a different function (according to https://divinglaravel.com/explaining-laravel-queue-configuration-keys).
Is there any way that at runtime I can set the retry_after
value dynamically?
For info, absolutely cannot hard set a value due to the way the app works (and refactoring other code in the app is a no-go), and the time it takes to run will always be an unknown so just creating separate long running queues or things like that won’t work either.