2020-03-23 21:31:35 +08:00
|
|
|
<?php
|
|
|
|
|
2021-06-04 04:17:16 +08:00
|
|
|
namespace App\Cron\Hourly;
|
2020-03-23 21:31:35 +08:00
|
|
|
|
|
|
|
use App\Contracts\Listener;
|
2021-06-04 04:17:16 +08:00
|
|
|
use App\Events\CronHourly;
|
2020-03-23 21:31:35 +08:00
|
|
|
use App\Services\SimBriefService;
|
2021-03-03 04:43:34 +08:00
|
|
|
use Illuminate\Support\Facades\Log;
|
2020-03-23 21:31:35 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear any expired SimBrief flight briefs that aren't attached to a PIREP
|
|
|
|
*/
|
|
|
|
class ClearExpiredSimbrief extends Listener
|
|
|
|
{
|
|
|
|
private $simbriefSvc;
|
|
|
|
|
|
|
|
public function __construct(SimBriefService $simbriefSvc)
|
|
|
|
{
|
|
|
|
$this->simbriefSvc = $simbriefSvc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \App\Events\CronNightly $event
|
|
|
|
*/
|
2021-06-04 04:17:16 +08:00
|
|
|
public function handle(CronHourly $event): void
|
2020-03-23 21:31:35 +08:00
|
|
|
{
|
2021-06-04 04:17:16 +08:00
|
|
|
Log::info('Hourly: Removing expired Simbrief entries');
|
2020-03-23 21:31:35 +08:00
|
|
|
$this->simbriefSvc->removeExpiredEntries();
|
|
|
|
}
|
|
|
|
}
|