From 5d74ae4c9f269b756d7877ad1527770c59846e14 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 13 Jul 2023 21:06:27 +0100 Subject: [PATCH] [4.x] Fixes unexpected jobs on Vapor (#1363) * Fixes unexpected jobs on Vapor * Rename variable --- src/Telescope.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Telescope.php b/src/Telescope.php index e88c82f8f..038dfa8a9 100644 --- a/src/Telescope.php +++ b/src/Telescope.php @@ -667,10 +667,13 @@ public static function store(EntriesRepository $storage) $storage->store(static::collectEntries($batchId)); - ($storage->update(static::collectUpdates($batchId)) ?: Collection::make()) - ->whenNotEmpty(fn ($pendingUpdates) => rescue(fn () => ProcessPendingUpdates::dispatch( + $updateResult = $storage->update(static::collectUpdates($batchId)) ?: Collection::make(); + + if (! isset($_ENV['VAPOR_SSM_PATH'])) { + $updateResult->whenNotEmpty(fn ($pendingUpdates) => rescue(fn () => ProcessPendingUpdates::dispatch( $pendingUpdates, )->delay(now()->addSeconds(10)))); + } if ($storage instanceof TerminableRepository) { $storage->terminate();