diff --git a/app/Listeners/SourceHeartbeatListener.php b/app/Listeners/SourceHeartbeatListener.php index dfa5c8ac..90f05d53 100644 --- a/app/Listeners/SourceHeartbeatListener.php +++ b/app/Listeners/SourceHeartbeatListener.php @@ -107,14 +107,14 @@ private function getLastFailoverLockTimestamp() private function getRecentFails() { - $fails = []; - try { $failsJson = Storage::get('failovers.json'); $fails = json_decode($failsJson, true); } catch (\Exception $e) { } + $fails = $fails ?? []; + // remove any fails greater than SOURCE_BAD_HEALTH_RANGE foreach ($fails as $fail) {