Skip to content

Commit

Permalink
Clean Up Cron Logs (#1864)
Browse files Browse the repository at this point in the history
Co-authored-by: Nabeel S. <nabeelio@users.noreply.github.com>
  • Loading branch information
arthurpar06 and nabeelio authored Sep 10, 2024
1 parent a367267 commit 82978f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions app/Cron/Nightly/RecalculateBalances.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public function handle(CronNightly $event): void
$this->journalRepo->recalculateBalance($journal);
$journal->refresh();

Log::info('Adjusting balance on '.
$journal->morphed_type.':'.$journal->morphed_id
.' from '.$old_balance.' to '.$journal->balance);
if (!$journal->balance->equals($old_balance)) {
Log::info('Adjusting balance on '.
$journal->morphed_type.':'.$journal->morphed_id
.' from '.$old_balance.' to '.$journal->balance);
}
}

Log::info('Done calculating balances');
Expand Down
8 changes: 4 additions & 4 deletions app/Cron/Nightly/SetActiveFlights.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function checkFlights(): void
if ($flight->start_date === null || $flight->end_date === null) {
if ($flight->days !== null && $flight->days > 0) {
$flight->visible = Days::isToday($flight->days);
if (!$flight->visible) {
/* if (!$flight->visible) {
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
}
} */
}

$flight->save();
Expand All @@ -69,10 +69,10 @@ public function checkFlights(): void
if ($today->gte($flight->start_date) && $today->lte($flight->end_date)) {
if ($flight->days !== null && $flight->days > 0) {
$flight->visible = Days::isToday($flight->days);
if (!$flight->visible) {
/*if (!$flight->visible) {
Log::info('Today='.date('N').', start=no, mask='.$flight->days.', in='
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
}
}*/
}
} else {
$flight->visible = false;
Expand Down

0 comments on commit 82978f5

Please sign in to comment.