We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea2caf9 commit 7eb22cbCopy full SHA for 7eb22cb
1 file changed
src/Tasks/Task.php
@@ -99,7 +99,15 @@ public function registerNextExecution(Carbon $now)
99
{
100
$cron = CronExpression::factory($this->expression);
101
$next_time = $now->copy()->addSecond();
102
- $this->next_execution_at = Carbon::instance($cron->getNextRunDate($next_time));
+ $calculated_next = Carbon::instance($cron->getNextRunDate($next_time));
103
+
104
+ // Correzione bug: verifica che la prossima esecuzione non sia nel passato
105
+ if ($calculated_next->lessThanOrEqualTo($now)) {
106
+ // Se la data calcolata è nel passato o uguale a ora, calcola la successiva
107
+ $calculated_next = Carbon::instance($cron->getNextRunDate($calculated_next->addSecond()));
108
+ }
109
110
+ $this->next_execution_at = $calculated_next;
111
}
112
113
public function delete()
0 commit comments