You are here

function elysia_cron_ping_page in Elysia Cron 7

Same name and namespace in other branches
  1. 5.2 elysia_cron.module \elysia_cron_ping_page()
  2. 5 elysia_cron.module \elysia_cron_ping_page()
  3. 6.2 elysia_cron.module \elysia_cron_ping_page()
  4. 6 elysia_cron.module \elysia_cron_ping_page()
  5. 7.2 elysia_cron.module \elysia_cron_ping_page()

Page callback for ping page. Throws 404 if cron hasn't been called within configured time period.

1 string reference to 'elysia_cron_ping_page'
elysia_cron_menu in ./elysia_cron.module

File

./elysia_cron.module, line 1317

Code

function elysia_cron_ping_page() {
  $last_run = _ec_variable_get('elysia_cron_last_run', 0);
  $diff = time() - $last_run;
  $max_interval = variable_get('elysia_cron_alert_interval', 60) * 60;
  if ($diff > $max_interval) {
    return drupal_not_found();
  }
  else {
    $aoutput = array();
    $aoutput[] = array(
      '#type' => 'markup',
      '#markup' => t('Cron has been called within maximum lapse time.'),
    );
    return _dcr_render_array($aoutput);
  }
}