function update_status_cron

7.x update_status.module update_status_cron()
6.x update_status.module update_status_cron()
4.x update_status.module update_status_cron()
5.x update_status.module update_status_cron()

Implementation of hook_cron()

We only want to check every few days that cron runs. Check with getflightpath.com, and, if updates are available, store that information in our variables table.

File

modules/update_status/update_status.module, line 94
The update status module file.

Code

function update_status_cron() {

  $check_if_older_than = strtotime("-3 DAY");
  // When was the last time we ran this check?
  // (we only want to run once every few days)
  $last_run = variable_get("update_status_last_run", 0);
  if ($last_run > $check_if_older_than) {
    // We have run this recently, harmlessly return
    // Comment out to have this run every time (good for development)
    return;
  }

  // If we are here, it means we should run our check.
  update_status_perform_check();

}