laravel-performance/app/Jobs/Mass/MassUpsert/MassUpsert2Job.php

39 lines
821 B
PHP

<?php
namespace App\Jobs\Mass\MassUpsert;
use App\Tasks\Mass\MassUpsert\MassUpsert2Task;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class MassUpsert2Job implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* The number of seconds the job can run before timing out.
*
* @var int
*/
public int $timeout = 3600; //20min
/**
* Create a new job instance.
*/
public function __construct(public int $count)
{
//
}
/**
* Execute the job.
*/
public function handle(): void
{
(new MassUpsert2Task())->handle($this->count);
}
}