diff --git a/app/Console/Commands/CatalogVerify.php b/app/Console/Commands/CatalogVerify.php index ca25f87..5d8b56d 100644 --- a/app/Console/Commands/CatalogVerify.php +++ b/app/Console/Commands/CatalogVerify.php @@ -9,8 +9,6 @@ use App\Jobs\CatalogVerify as Job; class CatalogVerify extends Command { - use DispatchesJobs; - /** * The name and signature of the console command. * @@ -44,7 +42,7 @@ class CatalogVerify extends Command public function handle() { if ($this->argument('type')) { - $this->dispatch(new Job($this->argument('type')))->onQueue('scan'); + Job::dispatch($this->argument('type'))->onQueue('scan'); } else { } diff --git a/app/Jobs/CatalogVerify.php b/app/Jobs/CatalogVerify.php index ad9cc57..0d5ab05 100644 --- a/app/Jobs/CatalogVerify.php +++ b/app/Jobs/CatalogVerify.php @@ -2,7 +2,9 @@ namespace App\Jobs; +use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Support\Facades\Log; @@ -11,7 +13,7 @@ use App\Traits\Type; class CatalogVerify extends Job implements ShouldQueue { - use InteractsWithQueue, SerializesModels, Type; + use Dispatchable, Queueable, InteractsWithQueue, SerializesModels, Type; // What we should verify private $type = NULL; @@ -39,7 +41,7 @@ class CatalogVerify extends Job implements ShouldQueue $good = $bad = $ugly = 0; - $result = $class::select('*')->each(function($o) use ($good,$bad,$ugly) { + $class::select('*')->each(function($o) use ($good,$bad,$ugly) { if (! file_exists($o->file_name(FALSE))) { Log::error(sprintf('Media doesnt exist: [%s] (%d:%s)',$this->type,$o->id,$o->file_name(FALSE))); $bad++;