From de5be9a2d21fc315e4ead4b7465f01087aae3f45 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 19 Dec 2025 20:46:50 +0100 Subject: [PATCH] wait #7909 @3.5 --- app/Console/Commands/ConvertArchivesToFluidbook.php | 2 +- app/Console/Commands/UpdateFluidbookIndex.php | 5 +++-- app/Console/Kernel.php | 1 - app/Http/Controllers/Admin/PublishController.php | 3 +-- app/PdfFile.php | 4 ++++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/ConvertArchivesToFluidbook.php b/app/Console/Commands/ConvertArchivesToFluidbook.php index ba3a881..00caa8a 100644 --- a/app/Console/Commands/ConvertArchivesToFluidbook.php +++ b/app/Console/Commands/ConvertArchivesToFluidbook.php @@ -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) diff --git a/app/Console/Commands/UpdateFluidbookIndex.php b/app/Console/Commands/UpdateFluidbookIndex.php index 104fb58..81d29a6 100644 --- a/app/Console/Commands/UpdateFluidbookIndex.php +++ b/app/Console/Commands/UpdateFluidbookIndex.php @@ -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); } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 099c741..ea13aa4 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -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 * *'); } diff --git a/app/Http/Controllers/Admin/PublishController.php b/app/Http/Controllers/Admin/PublishController.php index ca4f82c..136d6a0 100644 --- a/app/Http/Controllers/Admin/PublishController.php +++ b/app/Http/Controllers/Admin/PublishController.php @@ -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]; } diff --git a/app/PdfFile.php b/app/PdfFile.php index 4973546..7e421e5 100644 --- a/app/PdfFile.php +++ b/app/PdfFile.php @@ -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'); + }); } } -- 2.39.5