You are here

function brilliant_gallery_cron in Brilliant Gallery 6.4

Same name and namespace in other branches
  1. 6.3 brilliant_gallery.module \brilliant_gallery_cron()
  2. 7 brilliant_gallery_cron.inc \brilliant_gallery_cron()

File

./cron.inc, line 3

Code

function brilliant_gallery_cron() {

  // Delete all expired images from the file cache folder brilliant_gallery_pcache
  $last_bg_cron = variable_get('brilliant_gallery_last_cron', 0);

  // brilliant_gallery_cleantmpdir also needs to clear Drupal cache, but we don't want that to happen at every cron, so let's limit BG cron running to once in the cache expiration period.
  if (time() - $last_bg_cron > brilliant_gallery_get_days_in_seconds(variable_get('brilliant_gallery_cache_duration', 9))) {
    variable_set('brilliant_gallery_last_cron', time());
    brilliant_gallery_cleantmpdir();
    brilliant_gallery_clean_table_image_arrays();
  }
}