Skip to content

Commit

Permalink
[5.3] Improve inline comment for the "none-ID" behavior within the CR…
Browse files Browse the repository at this point in the history
…ON Scheduler (#43817)
  • Loading branch information
zero-24 authored Jan 7, 2025
1 parent e3f4cf9 commit 3dcafb5
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit 3dcafb5

Please sign in to comment.