This commit is contained in:
User
2025-01-18 19:05:23 -05:00
parent 3f282d6ecd
commit 14938f63df
23 changed files with 652 additions and 177 deletions

View File

@@ -6,10 +6,11 @@ use App\Models\Image;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Log;
use romanzipp\QueueMonitor\Traits\IsMonitored;
class ImageUpsert implements ShouldQueue
{
use Queueable;
use IsMonitored, Queueable;
/**
* Create a new job instance.
@@ -25,7 +26,12 @@ class ImageUpsert implements ShouldQueue
*/
public function handle(): void
{
$this->queueProgress(0);
Log::info("JOB ImageUpsert START, comicId: {$this->comicId}, chapterId: {$this->chapterId}");
$this->queueData([
'comicId' => $this->comicId,
'chapterId' => $this->chapterId,
]);
$arrayForUpsert = [];
@@ -47,5 +53,6 @@ class ImageUpsert implements ShouldQueue
Image::upsert($arrayForUpsert, uniqueBy: 'url');
Log::info('JOB ImageUpsert END');
$this->queueProgress(100);
}
}