Changes the timeout property to use the Timeout attribute
use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Queue\Attributes\Timeout;
+#[Timeout(120)]
final class ProcessPodcast implements ShouldQueue
{
- public $timeout = 120;
}
Configure your rector.php:
<?php
use RectorLaravel\Rector\Class_\TimeoutPropertyToTimeoutAttributeRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
TimeoutPropertyToTimeoutAttributeRector::class,
]);