Cron
class Cron implements CronInterface (View source)
The Drupal core Cron service.
Properties
| protected ModuleHandlerInterface | $moduleHandler | The module handler service. |
|
| protected LockBackendInterface | $lock | The lock service. |
|
| protected QueueFactory | $queueFactory | The queue service. |
|
| protected StateInterface | $state | The state service. |
|
| protected AccountSwitcherInterface | $accountSwitcher | The account switcher service. |
|
| protected LoggerInterface | $logger | A logger instance. |
|
| protected QueueWorkerManagerInterface | $queueManager | The queue plugin manager. |
|
| protected TimeInterface | $time | The time service. |
Methods
__construct(ModuleHandlerInterface $module_handler, LockBackendInterface $lock, QueueFactory $queue_factory, StateInterface $state, AccountSwitcherInterface $account_switcher, LoggerInterface $logger, QueueWorkerManagerInterface $queue_manager, TimeInterface $time = NULL)
Constructs a cron object.
bool
run()
Executes a cron run.
setCronLastTime()
Records and logs the request time for this cron invocation.
processQueues()
Processes cron queues.
invokeCronHandlers()
Invokes any cron handlers implementing hook_cron.
Details
__construct(ModuleHandlerInterface $module_handler, LockBackendInterface $lock, QueueFactory $queue_factory, StateInterface $state, AccountSwitcherInterface $account_switcher, LoggerInterface $logger, QueueWorkerManagerInterface $queue_manager, TimeInterface $time = NULL)
Constructs a cron object.
bool
run()
Executes a cron run.
Do not call this function from a test. Use $this->cronRun() instead.
protected
setCronLastTime()
Records and logs the request time for this cron invocation.
protected
processQueues()
Processes cron queues.
protected
invokeCronHandlers()
Invokes any cron handlers implementing hook_cron.