You are here

function blocked_ips_expire_cron in Blocked IPs Expire 7

Implements hook_cron().

File

./blocked_ips_expire.module, line 68
Hooks, callbacks and helper functions for the blocked_ips_expire module.

Code

function blocked_ips_expire_cron() {
  $expired_ips = _blocked_ips_expire_get_expired();

  // If there are IPs to delete, queue them for deletion.
  if (count($expired_ips) > 0) {
    $queue = DrupalQueue::get('blocked_ips_expire_cron_delete');
    foreach ($expired_ips as $expired_ip_entry) {
      $queue
        ->createItem($expired_ip_entry);
    }
  }
}