You are here

function sms_track_cron in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_track/sms_track.module \sms_track_cron()
  2. 6 modules/sms_track/sms_track.module \sms_track_cron()

Implements hook_cron().

File

modules/sms_track/sms_track.module, line 48
Message tracking feature module for Drupal SMS Framework.

Code

function sms_track_cron() {

  // Ensure that we only run at most once per hour
  $last_run = variable_get('sms_track_archive_cron_last_run', 0);
  $time_an_hour_ago = REQUEST_TIME - 3600;
  if ($last_run <= $time_an_hour_ago) {

    // Purge the archive
    sms_track_archive_purge();
    variable_set('sms_track_archive_cron_last_run', REQUEST_TIME);
  }
}