You are here

function elysia_cron_execute_aborted in Elysia Cron 7.2

Same name and namespace in other branches
  1. 5.2 elysia_cron.module \elysia_cron_execute_aborted()
  2. 5 elysia_cron.module \elysia_cron_execute_aborted()
  3. 6.2 elysia_cron.module \elysia_cron_execute_aborted()
  4. 6 elysia_cron.module \elysia_cron_execute_aborted()
  5. 7 elysia_cron.module \elysia_cron_execute_aborted()
2 calls to elysia_cron_execute_aborted()
elysia_cron_check_run_channel in ./elysia_cron.module
Check if the channel is idle (not running, or stuck). If so set returns available jobs.
elysia_cron_internal_execute_channel_cleanup in ./elysia_cron.module
Shutdown function for cron cleanup.

File

./elysia_cron.module, line 1583

Code

function elysia_cron_execute_aborted($channel) {
  global $_elysia_cron_settings_by_channel;
  $last_job = '';
  foreach ($_elysia_cron_settings_by_channel[$channel] as $job => $conf) {
    if ($job != '#data') {
      if (elysia_cron_is_job_running($job)) {
        $last_job .= ' ' . $job;
        elysia_cron_set_job_running($job, 0);
      }
    }
  }

  // In case the last function to run is longer than 128 chars, we cap the
  // length prior to placing in the database.
  $last_job = trim($last_job);
  if (strlen($last_job) > 128) {
    $last_job = substr($last_job, 0, 128);
  }
  elysia_cron_set($channel, TRUE, array(
    'running' => 0,
    //time(),.
    'last_aborted' => 1,
    'abort_count' => elysia_cron_get_channel_abort_count($channel) + 1,
    'last_abort_function' => $last_job,
  ));
  return $last_job;
}