Skip to content

Commit

Permalink
refactor: if statements in eligible to run method
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jun 24, 2024
1 parent 030402a commit ff593ef
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/Models/BackupTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,13 @@ public function eligibleToRunNow(): bool
if ($this->isReady() && $this->usingCustomCronExpression()) {
return $this->cronExpressionMatches();
}

if ($this->isReady() && ! $this->usingCustomCronExpression()) {
return $this->isTheRightTimeToRun();
if (!$this->isReady()) {
return false;
}

return false;
if ($this->usingCustomCronExpression()) {
return false;
}
return $this->isTheRightTimeToRun();
}

public function cronExpressionMatches(): bool
Expand Down

0 comments on commit ff593ef

Please sign in to comment.