You are here

public function QueueSettings::cron_pre_schedule in Ultimate Cron 8.2

Implements hook_cron_alter().

File

src/QueueSettings.php, line 187

Class

QueueSettings
Queue settings plugin class.

Namespace

Drupal\ultimate_cron

Code

public function cron_pre_schedule($job) {
  $queue_name = !empty($job->hook['settings']['queue']['name']) ? $job->hook['settings']['queue']['name'] : FALSE;
  if ($queue_name) {
    if (empty(self::$throttled[$job
      ->id()])) {
      self::$throttled[$job
        ->id()] = TRUE;
      $this
        ->throttle($job);
    }
  }
}