Fixed cronjobs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user