fix: check if absence is ended

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
Miguel Nogueira 2022-11-08 01:19:58 +00:00
parent 27ba576678
commit 35d112a5ca
No known key found for this signature in database
GPG Key ID: 3C6A7E29AF26D370
2 changed files with 1 additions and 3 deletions

View File

@ -45,8 +45,6 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
$schedule->command('vote:evaluate')
->daily();
// Production value: Every day

View File

@ -174,7 +174,7 @@ class AbsenceService
{
foreach (Absence::all() as $absence)
{
if (!Carbon::parse($absence->predicted_end)->isFuture()) {
if (!Carbon::parse($absence->predicted_end)->isFuture() && $absence->status !== 'ENDED') {
$this->endAbsence($absence);
}
}