You are here

public function SerialLauncher::isLockedMultiple in Ultimate Cron 8.2

Fallback implementation of multiple lock check.

Each launcher should implement an optimized version of this method if possible.

Parameters

\Drupal\ultimate_cron\CronJobInterface[] $jobs: Array of UltimateCronJobs to check.

Return value

array Array of lock ids, keyed by job name.

Overrides LauncherBase::isLockedMultiple

File

src/Plugin/ultimate_cron/Launcher/SerialLauncher.php, line 176

Class

SerialLauncher
Ultimate Cron launcher plugin class.

Namespace

Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher

Code

public function isLockedMultiple(array $jobs) {
  $names = array();
  foreach ($jobs as $job) {
    $names[] = $job
      ->id();
  }
  $lock = \Drupal::service('ultimate_cron.lock');
  $lock_ids = $lock
    ->isLockedMultiple($names);
  foreach ($lock_ids as &$lock_id) {
    $lock_id = $lock_id ? $this->pluginId . '-' . $lock_id : $lock_id;
  }
  return $lock_ids;
}