Files
investbrain/app/Jobs/QueuedCurrencyRateInsertJob.php
T

35 lines
595 B
PHP
Raw Normal View History

2025-04-09 19:25:15 -05:00
<?php
declare(strict_types=1);
namespace App\Jobs;
use App\Models\CurrencyRate;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
2025-04-11 20:57:21 -05:00
class QueuedCurrencyRateInsertJob implements ShouldQueue
2025-04-09 19:25:15 -05:00
{
use Queueable;
/**
* The number of times the job may be attempted.
*/
public $tries = 3;
public function __construct(
2025-04-11 20:57:21 -05:00
protected array $chunk
2025-04-09 19:25:15 -05:00
) {
2025-04-11 20:57:21 -05:00
$this->chunk = $chunk;
2025-04-09 19:25:15 -05:00
}
/**
* Execute the job.
*/
public function handle(): void
{
2025-04-11 20:57:21 -05:00
CurrencyRate::insertOrIgnore($this->chunk);
2025-04-09 19:25:15 -05:00
}
}