function Cron::__construct

Same name in this branch
  1. 11.x core/lib/Drupal/Core/ProxyClass/Cron.php \Drupal\Core\ProxyClass\Cron::__construct()
Same name in other branches
  1. 9 core/lib/Drupal/Core/ProxyClass/Cron.php \Drupal\Core\ProxyClass\Cron::__construct()
  2. 9 core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::__construct()
  3. 8.9.x core/lib/Drupal/Core/ProxyClass/Cron.php \Drupal\Core\ProxyClass\Cron::__construct()
  4. 8.9.x core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::__construct()
  5. 10 core/lib/Drupal/Core/ProxyClass/Cron.php \Drupal\Core\ProxyClass\Cron::__construct()
  6. 10 core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::__construct()

Constructs a cron object.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler: The module handler

\Drupal\Core\Lock\LockBackendInterface $lock: The lock service.

\Drupal\Core\Queue\QueueFactory $queueFactory: The queue service.

\Drupal\Core\State\StateInterface $state: The state service.

\Drupal\Core\Session\AccountSwitcherInterface $accountSwitcher: The account switching service.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Queue\QueueWorkerManagerInterface $queueManager: The queue plugin manager.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

array $queue_config: Queue configuration from the service container.

File

core/lib/Drupal/Core/Cron.php, line 59

Class

Cron
The Drupal core Cron service.

Namespace

Drupal\Core

Code

public function __construct(ModuleHandlerInterface $moduleHandler, LockBackendInterface $lock, QueueFactory $queueFactory, StateInterface $state, AccountSwitcherInterface $accountSwitcher, LoggerInterface $logger, QueueWorkerManagerInterface $queueManager, TimeInterface $time, array $queue_config) {
    $this->queueConfig = $queue_config + [
        'suspendMaximumWait' => 30.0,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.