You are here

function apigee_edge_cron in Apigee Edge 8

Implements hook_cron().

File

./apigee_edge.module, line 1559
Copyright 2018 Google Inc.

Code

function apigee_edge_cron() {

  /** @var \Drupal\apigee_edge\JobExecutor $executor */
  $executor = \Drupal::service('apigee_edge.job_executor');

  // Schedules 100 items from the job table.
  // The reason of this is to avoid race conditions.
  for ($i = 0; $i < 100; $i++) {
    if ($job = $executor
      ->select()) {
      $executor
        ->cast($job);
    }
    else {
      break;
    }
  }
}