You are here

function ultimate_cron_run_launchers in Ultimate Cron 7.2

Run all launchers.

2 calls to ultimate_cron_run_launchers()
UltimateCronSerialLauncher::launchPoorman in plugins/ultimate_cron/launcher/serial.class.php
Poormans cron launcher.
ultimate_cron_run_scheduled in ./ultimate_cron.module
Run scheduled jobs.
1 string reference to 'ultimate_cron_run_launchers'
UltimateCronBackgroundProcessLegacyLauncher::poormanLauncher in plugins/ultimate_cron/launcher/background_process_legacy.class.php
Poorman launcher background process callback.

File

./ultimate_cron.module, line 1632

Code

function ultimate_cron_run_launchers($launchers = NULL) {
  _ultimate_cron_variable_save('cron_last', time());
  $launcher_jobs = array();
  foreach (_ultimate_cron_job_load_all() as $job) {
    $launcher = $job
      ->getPlugin('launcher');
    if (!isset($launchers) || in_array($launcher->name, $launchers)) {
      $launcher_jobs[$launcher->name]['launcher'] = $launcher;
      $launcher_jobs[$launcher->name]['sort'] = array(
        $launcher->weight,
      );
      $launcher_jobs[$launcher->name]['jobs'][$job->name] = $job;
      $launcher_jobs[$launcher->name]['jobs'][$job->name]->sort = array(
        $job
          ->loadLatestLogEntry()->start_time,
      );
    }
  }
  uasort($launcher_jobs, '_ultimate_cron_multi_column_sort');
  foreach ($launcher_jobs as $name => $launcher_job) {
    uasort($launcher_job['jobs'], '_ultimate_cron_multi_column_sort');
    $launcher_job['launcher']
      ->launchJobs($launcher_job['jobs']);
  }
}