You are here

function sms_track_cron in SMS Framework 6.2

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

Implement hook_cron()

File

modules/sms_track/sms_track.module, line 57
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 = time() - 3600;
  if ($last_run <= $time_an_hour_ago) {

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