You are here

public function SerialLauncher::isLocked in Ultimate Cron 8.2

Check if a job is locked.

Parameters

\Drupal\ultimate_cron\CronJobInterface $job: The job to check.

Return value

string Lock ID of the locked job, FALSE if not locked.

Overrides LauncherInterface::isLocked

File

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

Class

SerialLauncher
Ultimate Cron launcher plugin class.

Namespace

Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher

Code

public function isLocked(CronJobInterface $job) {
  $lock = \Drupal::service('ultimate_cron.lock');
  $lock_id = $lock
    ->isLocked($job
    ->id());
  return $lock_id ? $this->pluginId . '-' . $lock_id : $lock_id;
}