0.1.4
This commit is contained in:
@@ -4,15 +4,13 @@ namespace App\Jobs;
|
||||
|
||||
use App\Models\Author;
|
||||
use App\Models\Comic;
|
||||
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 ComicUpsert implements ShouldQueue
|
||||
{
|
||||
use IsMonitored, Queueable;
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
@@ -26,7 +24,6 @@ class ComicUpsert implements ShouldQueue
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->queueProgress(0);
|
||||
Log::info("JOB ComicUpsert START");
|
||||
|
||||
$comicsUpsertArray = [];
|
||||
@@ -66,6 +63,5 @@ class ComicUpsert implements ShouldQueue
|
||||
}
|
||||
|
||||
Log::info('JOB ComicUpsert END');
|
||||
$this->queueProgress(100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ 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 IsMonitored, Queueable;
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
@@ -26,12 +25,7 @@ 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 = [];
|
||||
|
||||
@@ -53,6 +47,5 @@ class ImageUpsert implements ShouldQueue
|
||||
Image::upsert($arrayForUpsert, uniqueBy: 'url');
|
||||
|
||||
Log::info('JOB ImageUpsert END');
|
||||
$this->queueProgress(100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ use App\Remote\CopyManga;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use romanzipp\QueueMonitor\Traits\IsMonitored;
|
||||
|
||||
class RemotePrefetch implements ShouldQueue
|
||||
{
|
||||
use IsMonitored, Queueable;
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
@@ -25,17 +24,11 @@ class RemotePrefetch implements ShouldQueue
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->queueProgress(0);
|
||||
$copyManga = new CopyManga();
|
||||
|
||||
switch ($this->action) {
|
||||
case 'chapter':
|
||||
Log::info("JOB RemotePrefetch START, action '{$this->action}', Pathword: {$this->parameters['pathword']}, UUID: {$this->parameters['uuid']}");
|
||||
$this->queueData([
|
||||
'action' => $this->action,
|
||||
'pathword' => $this->parameters['pathword'],
|
||||
'uuid' => $this->parameters['uuid']
|
||||
]);
|
||||
|
||||
$copyManga->chapter($this->parameters['pathword'], $this->parameters['uuid']);
|
||||
|
||||
@@ -46,13 +39,6 @@ class RemotePrefetch implements ShouldQueue
|
||||
break;
|
||||
case 'comics':
|
||||
Log::info("JOB RemotePrefetch START, action '{$this->action}', Offset: {$this->parameters['offset']}");
|
||||
$this->queueData([
|
||||
'action' => $this->action,
|
||||
'offset' => $this->parameters['offset'],
|
||||
'limit' => $this->parameters['limit'],
|
||||
'top' => $this->parameters['top'],
|
||||
'params' => $this->parameters['params']
|
||||
]);
|
||||
|
||||
$copyManga->comics($this->parameters['offset'], $this->parameters['limit'], $this->parameters['top'], $this->parameters['params']);
|
||||
|
||||
@@ -62,7 +48,5 @@ class RemotePrefetch implements ShouldQueue
|
||||
Log::info("JOB RemotePrefetch Unknown action '{$this->action}'");
|
||||
break;
|
||||
}
|
||||
|
||||
$this->queueProgress(100);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user