You are here

public function UltimateCronSerialLauncher::lock in Ultimate Cron 7.2

Lock job.

Overrides UltimateCronLauncher::lock

File

plugins/ultimate_cron/launcher/serial.class.php, line 135
Serial cron job launcher for Ultimate Cron.

Class

UltimateCronSerialLauncher
Ultimate Cron launcher plugin class.

Code

public function lock($job) {
  $settings = $job
    ->getSettings($this->type);
  $timeout = $settings['lock_timeout'];
  $class = _ultimate_cron_get_class('lock');
  if ($lock_id = $class::lock($job->name, $timeout)) {
    $lock_id = $this->name . '-' . $lock_id;
    return $lock_id;
  }
  return FALSE;
}