Fixed cronjobs

This commit is contained in:
th.guenther committed 2026-05-14 16:58:41 +02:00
1 parent 30cc0b79c5
commit 454d83de2e
4 files changed
+34 -18

No files matched your search

+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);
}
}