Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Improve inline comment for the "none-ID" behavior within the CRON Scheduler #43817

Merged
merged 19 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ public function runLazyCron(EventInterface $e)
}

/**
* This method is responsible for the WebCron functionality of the Scheduler component.<br/>
* This method is responsible for the WebCron functionality of the Scheduler component.
* Acting on a `com_ajax` call, this method can work in two ways:
* 1. If no Task ID is specified, it triggers the Scheduler to run the next task in
* the task queue.
* 2. If a Task ID is specified, it fetches the task (if it exists) from the Scheduler API and executes it.<br/>
* 1. If no Task ID is specified, it triggers the Scheduler to run the next task in the task queue.
* 2. If a Task ID is specified, it fetches the task (if it exists) from the Scheduler API and executes it.
*
* URL query parameters:
* - `hash` string (required) Webcron hash (from the Scheduler component configuration).
Expand Down Expand Up @@ -202,8 +201,10 @@ public function runWebCron(Event $event)
throw new \Exception($this->getApplication()->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
}

// Check whether there is an id passed via the URL
$id = (int) $this->getApplication()->getInput()->getInt('id', 0);

// When the id is set to 0 the next task is executed
$task = $this->runScheduler($id);

if (!empty($task) && !empty($task->getContent()['exception'])) {
Expand Down