Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 29, 2025
1 parent b024b37 commit 8941081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Jobs/ProcessPendingUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ public function handle(EntriesRepository $repository)
{
$this->attempt++;

$delay = config('telescope.queue.delay');

$repository->update($this->pendingUpdates)->whenNotEmpty(
fn ($pendingUpdates) => static::dispatchIf(
$this->attempt < 3, $pendingUpdates, $this->attempt
)->onConnection(
config('telescope.queue.connection')
)->onQueue(
config('telescope.queue.queue')
)->delay(config('telescope.queue.delay') ? now()->addSeconds(config('telescope.queue.delay')) : null),
)->delay(is_numeric($delay) && $delay > 0 ? now()->addSeconds($delay) : null),
);
}
}
4 changes: 3 additions & 1 deletion src/Telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,15 @@ public static function store(EntriesRepository $storage)
$updateResult = $storage->update(static::collectUpdates($batchId)) ?: Collection::make();

if (! isset($_ENV['VAPOR_SSM_PATH'])) {
$delay = config('telescope.queue.delay');

$updateResult->whenNotEmpty(fn ($pendingUpdates) => rescue(fn () => ProcessPendingUpdates::dispatch(
$pendingUpdates,
)->onConnection(
config('telescope.queue.connection')
)->onQueue(
config('telescope.queue.queue')
)->delay(config('telescope.queue.delay') ? now()->addSeconds(config('telescope.queue.delay')) : null)));
)->delay(is_numeric($delay) && $delay > 0 ? now()->addSeconds($delay) : null)));
}

if ($storage instanceof TerminableRepository) {
Expand Down

0 comments on commit 8941081

Please sign in to comment.