You are here

function elysia_cron_should_run in Elysia Cron 6.2

Same name in this branch
  1. 6.2 elysia_cron_scheduler.inc \elysia_cron_should_run()
  2. 6.2 elysia_cron_scheduler_old.inc \elysia_cron_should_run()
Same name and namespace in other branches
  1. 5.2 elysia_cron_scheduler.inc \elysia_cron_should_run()
  2. 5.2 elysia_cron_scheduler_old.inc \elysia_cron_should_run()
  3. 5 elysia_cron_scheduler.inc \elysia_cron_should_run()
  4. 5 elysia_cron_scheduler_old.inc \elysia_cron_should_run()
  5. 6 elysia_cron_scheduler.inc \elysia_cron_should_run()
  6. 6 elysia_cron_scheduler_old.inc \elysia_cron_should_run()
  7. 7.2 elysia_cron_scheduler.inc \elysia_cron_should_run()
  8. 7 elysia_cron_scheduler.inc \elysia_cron_should_run()
  9. 7 elysia_cron_scheduler_old.inc \elysia_cron_should_run()
6 calls to elysia_cron_should_run()
drush_elysia_cron_run_wrapper in ./elysia_cron.drush.inc
A drush command callback.
elysia_cron_active_jobs in ./elysia_cron.module
Get all jobs that needs to be executed in a channel
elysia_cron_admin_page in ./elysia_cron.admin.inc
elysia_cron_run_job in ./elysia_cron.module
Public function to execute a single job
test_elysia_cron_should_run in ./elysia_cron_scheduler.inc

... See full list

File

./elysia_cron_scheduler.inc, line 3

Code

function elysia_cron_should_run($conf, $now = -1, $ignore_disable = false, $ignore_time = false) {
  $prev_rule_run = 0;

  // What time SHOULD the job be executed last time
  if (!$ignore_disable && $conf['disabled']) {
    return false;
  }
  if ($ignore_time) {
    return true;
  }
  if ($now < 0) {
    $now = time();
  }
  if (!$conf['last_run'] || $now - $conf['last_run'] > 365 * 86400) {
    return true;
  }
  $next_run = _elysia_cron_next_run($conf);
  return $now >= $next_run;
}