29 lines
602 B
PHP
29 lines
602 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\Photo;
|
|
use App\Services\MnemonicScanService;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
|
|
class ScanPhotoMnemonic implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public int $tries = 1;
|
|
|
|
public int $timeout = 120;
|
|
|
|
public function __construct(public int $photoId) {}
|
|
|
|
public function handle(MnemonicScanService $scan): void
|
|
{
|
|
$photo = Photo::query()->with('device')->find($this->photoId);
|
|
if ($photo === null) {
|
|
return;
|
|
}
|
|
$scan->scanPhoto($photo);
|
|
}
|
|
}
|