Create a Scheduled task with Manual Execution. For example, change the default task Session GC to manual
Set another task on a short schedule.
Execute the webcron with id=0 (to bypass #43576 , looks solved #43164)
component/ajax/?plugin=RunSchedulerWebcron&group=system&format=json&hash=XXXX&id=0
or run the lazy scheduler
all (id=0) due tasks are executed one by one on each call.
Manual tasks are skipped
No task is executed.
Found in Joomla 4.4.6 and up
manual tasks should only be executed when called explicitly
component/ajax/?plugin=RunSchedulerWebcron&group=system&format=json&hash=XXXX&id=
The database column for next_execution is set to Null for Manual tasks
In the code in TaskModel:getTask $idQuery loads the first 'due' task order by next_execution, this is a task with next_execution=Null
Then the $lockQuery uses
$lockQuery->where($db->quoteName('next_execution') . ' <= :now2')
Which does not return the next_execution with value Null.
So the $lockQuery never finds a tasks.
The idQuery should probably have a ->where($db->quoteName('next_execution') .' IS NOT Null')
It looks like there are more possible issues.
cli_exclusive might be set to zero, while the idQuery ignores this setting. Same for allowDisabled
I think the queries in the code block shown below should be part of idQuery as well (and maybe even not lockQuery)
if (!$options['includeCliExclusive']) {
$lockQuery->where($db->quoteName('cli_exclusive') . ' = 0');
}
if (!$options['bypassScheduling']) {
$lockQuery->where($db->quoteName('next_execution') . ' <= :now2')
->bind(':now2', $now);
}
if ($options['allowDisabled']) {
$lockQuery->whereIn($db->quoteName('state'), [0, 1]);
} else {
$lockQuery->where($db->quoteName('state') . ' = 1');
}
Labels |
Added:
No Code Attached Yet
|
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-07-13 10:34:18 |
Closed_By | ⇒ | alikon |
please test #43784