Skip to content

Commit

Permalink
[4.x] Fixes unexpected jobs on Vapor (#1363)
Browse files Browse the repository at this point in the history
* Fixes unexpected jobs on Vapor

* Rename variable
  • Loading branch information
nunomaduro authored Jul 13, 2023
1 parent 61c1565 commit 5d74ae4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5d74ae4

Please sign in to comment.