laravel-performance/app/Jobs/MassInsert/MassInsert1Job.php

40 lines
856 B
PHP

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