]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5898 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Apr 2023 17:55:16 +0000 (19:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Apr 2023 17:55:16 +0000 (19:55 +0200)
app/Console/Kernel.php
app/Jobs/Maintenance/CheckPublicationsHashAndCid.php

index 580b5880116aa7c0c0a4fb7d823bc398b46b4129..fd35aa8583df0fd88166e8c8d8b9390ac867bcf1 100644 (file)
@@ -29,7 +29,8 @@ class Kernel extends \Cubist\Backpack\Console\Kernel
         // $schedule->command('backup:clean')->daily()->at('04:00');
         // $schedule->command('backup:run')->daily()->at('05:00');
 
-        if (config('env') === 'production') {
+        if (config('app.env') === 'production') {
+            $schedule->command('job:dispatchNow Maintenance\\\\CheckPublicationsHashAndCid')->dailyAt('3:00');
             $schedule->command('job:dispatchNow Maintenance\\\\CleanDownloads')->dailyAt('4:00');
             $schedule->command('job:dispatchNow Maintenance\\\\CleanFTP')->dailyAt('4:30');
             $schedule->command('ws:migrate --publications=v2 --documents=missing')->dailyAt('1:00');
index c04982d6f28b3ef6effd38722e13aab5666abf56..1e2b0054ff8bb62935660d5591643bd2a09947c0 100644 (file)
@@ -4,7 +4,7 @@ namespace App\Jobs\Maintenance;
 
 use App\Jobs\Base;
 use App\Models\FluidbookPublication;
-use App\Models\Traits\CheckHash;
+use Illuminate\Support\Facades\Log;
 
 class CheckPublicationsHashAndCid extends Base
 {
@@ -12,8 +12,8 @@ class CheckPublicationsHashAndCid extends Base
     {
         /** @var FluidbookPublication $fluidbook */
         foreach (FluidbookPublication::withoutGlobalScopes()->where('created_ok', '1')->whereNull('hash')->orWhere('hash', '')->orWhereNull('cid')->orWhere('cid', '')->get() as $fluidbook) {
+            Log::warning('Fluidbook #' . $fluidbook->id . ' had empty hash or cid (hash: hash , cid: :cid)', ['hash' => $fluidbook->hash, 'cid' => $fluidbook->cid]);
             $fluidbook->save();
-            echo 'Process ' . $fluidbook->id . "\n";
         }
     }
 }