From 0578f98b584b900bc77980ec6461fd5069c882f2 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 21 Jan 2021 10:57:51 -0500 Subject: [PATCH] Force flight to visible before day checks --- app/Cron/Nightly/SetActiveFlights.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Cron/Nightly/SetActiveFlights.php b/app/Cron/Nightly/SetActiveFlights.php index 95ca347b..3dda0707 100644 --- a/app/Cron/Nightly/SetActiveFlights.php +++ b/app/Cron/Nightly/SetActiveFlights.php @@ -42,6 +42,9 @@ class SetActiveFlights extends Listener continue; } + // Set to visible by default + $flight->visible = true; + // dates aren't set, so just save if there were any changes above // and move onto the next one if ($flight->start_date === null || $flight->end_date === null) { @@ -56,9 +59,6 @@ class SetActiveFlights extends Listener .Days::in($flight->days, Days::$isoDayMap[(int) date('N')])); } } - } else { - Log::info('Toggling flight '.$flight->ident.' to visible'); - $flight->visible = true; } $flight->save(); @@ -82,9 +82,6 @@ class SetActiveFlights extends Listener .Days::in($flight->days, Days::$isoDayMap[(int) date('N')])); } } - } else { - Log::info('Toggling flight '.$flight->ident.' to visible'); - $flight->visible = true; } } else { $flight->visible = false;