You are here

public static function CronSignal::peek in Ultimate Cron 8.2

Get a signal without claiming it.

Parameters

string $name: The name of the job.

string $signal: The name of the signal.

Return value

string The signal if any.

File

src/CronSignal.php, line 17

Class

CronSignal

Namespace

Drupal\ultimate_cron

Code

public static function peek($name, $signal) {
  $database = \Drupal::service('ultimate_cron.database_factory');
  return $database
    ->select('ultimate_cron_signal', 's')
    ->fields('s', array(
    'job_name',
  ))
    ->condition('job_name', $name)
    ->condition('signal_name', $signal)
    ->condition('claimed', 0)
    ->execute()
    ->fetchField();
}