I'm using Laravel 10 and PHP 8.1. I have a website monitoring platform which customers can add their websites and they're checked at an interval to see if the sites are up or down. My cron runs every minute.
My Job, UptimeChecker seems to be firing a lot of Illuminate\Queue\MaxAttemptsExceededException exceptions, and I'm wondering what I could be missing to significantly reduce, or get rid of them entirely.
I'm using supervisor, and have 32 workers configured, I'm specifying --tries=2 on my php artisan queue:work command and have set the following in my UptimeChecker job:
/**
* The number of seconds the job can run before timing out.
*
* @var int
*/
public $timeout = 60;
My database connection for the queue is configured like this:
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 180,
'after_commit' => false,
],
Since retry_after is 180, and my timeout is 60, I'm not sure why I'm getting this error?
Illuminate\Queue\MaxAttemptsExceededException: App\Jobs\UptimeChecker has been attempted too many times or run too long. The job may have previously timed out. in /var/www/domain-monitor-api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:780