mardi 16 mars 2021

Laravel 5.5 Queue Job doesn't respect timeout

I have a job in Laravel 5.5 that doesn't respect the value in the variable public $timeout set on the job as described in the laravel documentation.

If I set the value of $timeout to, for example, 120 seconds I would expect the job to be terminated after it has ran for 120 seconds. I'm using RabbitMQ on a Heroku dyno.

Codebase: Laravel 5.5

Extension: RabbitMQ Queue driver for Laravel

Platform: Heroku dyno (Amazon).

Example code:

class ExampleJob implements ShouldQueue
{
    use InteractsWithQueue, Queueable, SerializesModels;

    public $timeout = 120;

    public function handle()
    {
        DB::statement($this->buildCallStatement());
    }
}

Example Procfile:

worker: php artisan queue:listen rabbitmq --queue=high,medium,low --tries=1 --memory=512 --timeout=0


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3bRXWXd
via IFTTT

Aucun commentaire:

Enregistrer un commentaire