mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Doc: [cronjob manager] Doc for implementing cronjob
This commit is contained in:
@@ -19,6 +19,25 @@ use Exception;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* Manage cronjob and execute them.
|
||||
*
|
||||
* If any :code:`job` argument is given, the :code:`CronManager` schedule job with those steps:
|
||||
*
|
||||
* - the tasks are ordered, with:
|
||||
* - a priority is given for tasks that weren't never executed;
|
||||
* - then, the tasks are ordered, the last executed are the first in the list
|
||||
*
|
||||
* Then, for each tasks, and in the given order, the first task where :code:`canRun` return :code:`TRUE` will be executed.
|
||||
*
|
||||
* The error inside job execution are catched (with the exception of _out of memory error_).
|
||||
*
|
||||
* The manager will mark the task as executed even if an error is catched. This will lead as failed job
|
||||
* will not have priority any more on other tasks.
|
||||
*
|
||||
* If a tasks is "forced", there is no test about eligibility of the task (the `canRun` method is not called),
|
||||
* and the last task execution is not recorded.
|
||||
*/
|
||||
class CronManager implements CronManagerInterface
|
||||
{
|
||||
private const LOG_PREFIX = '[cron manager] ';
|
||||
|
Reference in New Issue
Block a user