You are here

function imagecache_external_cron in Imagecache External 7.2

Same name and namespace in other branches
  1. 8 imagecache_external.module \imagecache_external_cron()

Implements hook_cron().

File

./imagecache_external.module, line 10
Allows the usage of Image Styles on external images.

Code

function imagecache_external_cron() {
  $now = time();
  $last_run_timestamp = variable_get('imagecache_external_cron_last_run', 0);

  // Run every 24 hours.
  if ($now - $last_run_timestamp > 3600 * 24) {
    imagecache_external_flush_cache('cron');
    variable_set('imagecache_external_cron_last_run', $now);
  }
}