diff --git a/src/Commands/CheckCommand.php b/src/Commands/CheckCommand.php index 442313b2..05b18d14 100644 --- a/src/Commands/CheckCommand.php +++ b/src/Commands/CheckCommand.php @@ -51,17 +51,17 @@ public function handle( $instance = Str::random(); while (true) { - $now = CarbonImmutable::now(); - if ($lastRestart !== $cache->store()->get('laravel:pulse:restart')) { return self::SUCCESS; } + $now = CarbonImmutable::now(); + if ($lock?->get()) { - $event->dispatch(new IsolatedBeat($now)); + $pulse->rescue(fn () => $event->dispatch(new IsolatedBeat($now))); } - $event->dispatch(new SharedBeat($now, $instance)); + $pulse->rescue(fn () => $event->dispatch(new SharedBeat($now, $instance))); $pulse->ingest();