Skip to content

Commit

Permalink
fix is fire only
Browse files Browse the repository at this point in the history
  • Loading branch information
tomahock committed May 27, 2024
1 parent cc006b2 commit cb48332
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 0 additions & 2 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ protected function schedule(Schedule $schedule)
$schedule->job(new UpdateICNFData(4))->cron('0 3 * * 1,5'); // twice a week, monday and thursday
$schedule->job(new UpdateICNFData(5))->cron('0 3 * * 1,5'); // twice a week, monday and thursday
$schedule->job(new UpdateICNFData(6))->cron('0 3 * * 3'); // once a week, wednesday
$schedule->job(new UpdateICNFData(7))->monthly();
$schedule->job(new UpdateICNFData(8))->cron('0 0 1 */2 *'); // every two months


$schedule->job(new UpdateWeatherStations())->daily()->at('03:21');
Expand Down
23 changes: 2 additions & 21 deletions app/Jobs/UpdateICNFData.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,12 @@ public function handle()
[
'before' => Carbon::now()->subDays(90),
'after' => Carbon::now()->subDays(180),
],
[
'before' => Carbon::now()->subDays(180),
'after' => Carbon::now()->subDays(360),
],
[
'before' => Carbon::now()->subDays(360),
'after' => Carbon::now()->subDays(540),
],
[
'before' => Carbon::now()->subDays(540),
'after' => Carbon::now()->subDays(720),
],
[
'before' => Carbon::now()->subDays(720),
'after' => Carbon::now()->subDays(900),
],
[
'before' => Carbon::now()->subDays(900),
'after' => Carbon::now()->subDays(1080),
],
]
];

$incidents = Incident::where('created', '>=', $intervals[$this->interval]['after'])
->where('created', '<=', $intervals[$this->interval]['before'])
->whereq('isFire', true)
->get();

foreach ($incidents as $incident) {
Expand Down

0 comments on commit cb48332

Please sign in to comment.