Make sure all dates are in UTC (#1139)

This commit is contained in:
Nabeel S
2021-04-13 09:25:38 -04:00
committed by GitHub
parent 7e9eb08135
commit bfddb2c84d
9 changed files with 16 additions and 13 deletions

View File

@@ -37,7 +37,7 @@ class DeletePireps extends Listener
*/
protected function deletePireps(int $expire_time_hours, int $state)
{
$dt = Carbon::now()->subHours($expire_time_hours);
$dt = Carbon::now('UTC')->subHours($expire_time_hours);
$pireps = Pirep::where('created_at', '<', $dt)->where(['state' => $state])->get();
/** @var PirepService $pirepSvc */

View File

@@ -25,7 +25,7 @@ class RemoveExpiredBids extends Listener
return;
}
$date = Carbon::now()->subHours(setting('bids.expire_time'));
$date = Carbon::now('UTC')->subHours(setting('bids.expire_time'));
Bid::where('created_at', '<', $date)->delete();
}
}

View File

@@ -26,7 +26,7 @@ class RemoveExpiredLiveFlights extends Listener
return;
}
$date = Carbon::now()->subHours(setting('acars.live_time'));
$date = Carbon::now('UTC')->subHours(setting('acars.live_time'));
Pirep::where('updated_at', '<', $date)
->where('state', PirepState::IN_PROGRESS)
->delete();