]> _ Git - psq.git/commitdiff
wait #7909 @3.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 19 Dec 2025 19:46:50 +0000 (20:46 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 19 Dec 2025 19:46:50 +0000 (20:46 +0100)
app/Console/Commands/ConvertArchivesToFluidbook.php
app/Console/Commands/UpdateFluidbookIndex.php
app/Console/Kernel.php
app/Http/Controllers/Admin/PublishController.php
app/PdfFile.php

index ba3a881b8a35e4f0c4c22cd371a0c3ab3b09c92f..00caa8a3e1f9187898af87edfc4daf7045b40644 100644 (file)
@@ -47,10 +47,10 @@ class ConvertArchivesToFluidbook extends Command
 
             if ($res) {
                 Cache::forever($cacheKey, $res);
-                Artisan::call('psq:fluidbook:updateindex');
             }
             sleep(30);
         }
+        Artisan::call('psq:fluidbook:updateindex');
     }
 
     public static function getCacheKey($reference)
index 104fb58f13ccf8e66b7c0c930601ed6694594d3b..81d29a67d72afe5e9f3ce62ae2396f1733ca20d5 100644 (file)
@@ -23,8 +23,9 @@ class UpdateFluidbookIndex extends Command
                 $publications[] = ['fluidbook' => $fluidbook->id];
             }
         }
-        $client->setFluidbooksInCollection(config('fluidbook.collection'), $publications);
-        $client->collectionRefreshSearchIndex(config('fluidbook.collection'));
+        $collection = config('fluidbook.collection');
+        $client->setFluidbooksInCollection($collection, $publications);
+        $client->collectionRefreshSearchIndex($collection);
     }
 
 }
index 099c7418d62766ccedd46412d28b76d65a21c45a..ea13aa4913299493a31dfd5ac9e32c8a1a5ed4a4 100644 (file)
@@ -26,7 +26,6 @@ class Kernel extends ConsoleKernel
     protected function schedule(Schedule $schedule)
     {
         $schedule->job(new CheckForTrialExpirationDates)->dailyAt('13:00');
-        $schedule->command('psq:fluidbook:archives')->dailyAt('04:00');
         $schedule->command('psq:fluidbook:updatedemo')->cron('0 4 1,15 * *');
     }
 
index ca4f82c74b5dac4c520e7d6545dd03ad7a4ff565..136d6a0c7274cb1b3726768c1e98307ce4bf1f3c 100644 (file)
@@ -70,7 +70,7 @@ class PublishController extends Controller
 
         $batch = EmailBatch::createFromRequest($data);
         $processEmailBatch = new ProcessEmailBatch($batch, $usersBuilder);
-        dispatch_sync($processEmailBatch);
+        dispatch($processEmailBatch);
 
 //        if ($pdfBatch = EmailBatch::createAttachmentMailFromRequest($data)) {
 //            $userReceivesPdfBuilder->subscriber()->receivesPdf();
@@ -79,7 +79,6 @@ class PublishController extends Controller
 //        }
 
 
-
         return ['data' => $batch->id];
     }
 
index 4973546f7cf015e98dafe9c8040fcee96cd2e744..7e421e5befe65bef2b3c92a9a76037765fa4a12b 100644 (file)
@@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations;
 use Illuminate\Http\File;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Artisan;
 use Illuminate\Support\Facades\Cache;
 use Laravel\Nova\Fields\HasOne;
 use Storage;
@@ -162,6 +163,9 @@ class PdfFile extends TwillModel implements Sortable
 
         if ($res) {
             Cache::forever(self::getCacheKey($this->slug), $res);
+            dispatch(function () {
+                Artisan::call('psq:fluidbook:updateindex');
+            });
         }
 
     }