Fixed cronjobs

This commit is contained in:
2026-05-14 16:58:41 +02:00
parent 30cc0b79c5
commit 454d83de2e
4 changed files with 34 additions and 18 deletions
+5 -2
View File
@@ -41,10 +41,13 @@ class CronTaskHandleProvider extends CommonController
// --- Daily Tasks ---
if ($task->execution_type === CronTaskType::CRON_TASK_TYPE_DAILY) {
$scheduledTime = $task->schedule_time;
$scheduledTime = \DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d ') . $task->schedule_time);
$now = Carbon::now();
$alreadyRunToday = $task->last_run?->isToday() ?? false;
if (!$alreadyRunToday && $now->format('H:i') === $scheduledTime) {
if (!$alreadyRunToday && $now >= $scheduledTime) {
$this->runTask($task);
}
}