Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Queue/QueueWorkerManager.php \Drupal\Core\Queue\QueueWorkerManager::processDefinition()
  2. 9 core/lib/Drupal/Core/Queue/QueueWorkerManager.php \Drupal\Core\Queue\QueueWorkerManager::processDefinition()

File

core/lib/Drupal/Core/Queue/QueueWorkerManager.php, line 41

Class

QueueWorkerManager
Defines the queue worker manager.

Namespace

Drupal\Core\Queue

Code

public function processDefinition(&$definition, $plugin_id) {
  parent::processDefinition($definition, $plugin_id);

  // Safeguard to ensure the default lease time is used in the case of a
  // malformed queue worker annotation where cron is specified without a time,
  // or an invalid time is provided.
  //
  // @see \Drupal\Core\Cron::processQueues()
  if (isset($definition['cron'])) {
    $time = $definition['cron']['time'] ?? 0;
    if ($time <= 0) {
      $definition['cron']['time'] = self::DEFAULT_QUEUE_CRON_TIME;
    }
  }
}