You are here

function elysia_cron_cleanup in Elysia Cron 5

Same name and namespace in other branches
  1. 5.2 elysia_cron.module \elysia_cron_cleanup()
  2. 6 elysia_cron.module \elysia_cron_cleanup()
  3. 7 elysia_cron.module \elysia_cron_cleanup()

Shutdown function for cron cleanup.

Used for unexpected termination of code.

1 string reference to 'elysia_cron_cleanup'
elysia_cron_run in ./elysia_cron.module

File

./elysia_cron.module, line 1140

Code

function elysia_cron_cleanup() {
  global $elysia_cron_settings, $elysia_cron_current_channel, $cron_completed, $cron_completed_time;
  if ($cron_completed) {
    return;
  }

  // See if the semaphore is still locked.
  if (elysia_cron_is_channel_running($elysia_cron_current_channel)) {
    $last_job = elysia_cron_execute_aborted($elysia_cron_current_channel);
    _dco_watchdog('cron', 'Unexpected termination of cron channel %channel, aborted. Last job executed: %job', array(
      '%channel' => $elysia_cron_current_channel,
      '%job' => $last_job,
    ), WATCHDOG_WARNING);
  }
}