You are here

function elysia_cron_check_run_job in Elysia Cron 6.2

Same name and namespace in other branches
  1. 7.2 elysia_cron.module \elysia_cron_check_run_job()
2 calls to elysia_cron_check_run_job()
elysia_cron_internal_execute_channel in ./elysia_cron.module
Internal function to execute all jobs in a channel elysia_cron_lock_env() must be called BEFORE calling this method
elysia_cron_run_job in ./elysia_cron.module
Public function to execute a single job

File

./elysia_cron.module, line 1314

Code

function elysia_cron_check_run_job($job) {
  $job_running = false;
  if (elysia_cron_is_job_running($job)) {
    if (time() - elysia_cron_get_job_last_run($job, 0) > variable_get('elysia_cron_stuck_time', 3600)) {
      elysia_cron_warning('Job %job is already running, but is probably stuck, so i consider it as terminated', array(
        '%job' => $job,
      ));
    }
    else {
      elysia_cron_warning('Job %job is already running', array(
        '%job' => $job,
      ));
      $job_running = true;
    }
  }
  return $job_running;
}