Files
pricebuddy/app/Jobs/UpdateAllPricesJob.php

26 lines
579 B
PHP

<?php
namespace App\Jobs;
use App\Services\PriceFetcherService;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Foundation\Queue\Queueable;
class UpdateAllPricesJob implements ShouldQueue
{
use Dispatchable;
use Queueable;
public $timeout = PriceFetcherService::JOB_TIMEOUT;
public function __construct(protected array $productIds = []) {}
public function handle(): void
{
PriceFetcherService::new()
->setLogging(true)
->updatePrices($this->productIds);
}
}