From 7e9eb081359ee7352120fc269cb6f364ccf56ec8 Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" <74361521+FatihKoz@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:08:50 +0300 Subject: [PATCH] Use where iso whereTime (#1137) Using whereTime may present a problem for flights conducted during utc midnight and some active/live flights may be deleted with whereTime. Scenario; now = today-01:00 utc setting = 2 hours date = yesterday-23:00 utc Any live pireps will/may be deleted with whereTime 'cause their last updated TIME will be maximum 00:59 which is smaller than 23:00. --- app/Cron/Hourly/RemoveExpiredLiveFlights.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Cron/Hourly/RemoveExpiredLiveFlights.php b/app/Cron/Hourly/RemoveExpiredLiveFlights.php index 5aaf9cc9..eff4b279 100644 --- a/app/Cron/Hourly/RemoveExpiredLiveFlights.php +++ b/app/Cron/Hourly/RemoveExpiredLiveFlights.php @@ -27,7 +27,7 @@ class RemoveExpiredLiveFlights extends Listener } $date = Carbon::now()->subHours(setting('acars.live_time')); - Pirep::whereTime('updated_at', '<', $date) + Pirep::where('updated_at', '<', $date) ->where('state', PirepState::IN_PROGRESS) ->delete(); }