You are here

function brilliant_gallery_cron in Brilliant Gallery 7

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

Delete all expired images from the file cache folder brilliant_gallery_pcache.

1 string reference to 'brilliant_gallery_cron'
brilliant_gallery.module in ./brilliant_gallery.module

File

./brilliant_gallery_cron.inc, line 6

Code

function brilliant_gallery_cron() {
  $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 (REQUEST_TIME - $last_bg_cron > brilliant_gallery_get_days_in_seconds(variable_get('brilliant_gallery_cache_duration', 90))) {
    variable_set('brilliant_gallery_last_cron', REQUEST_TIME);
    brilliant_gallery_cleantmpdir();
    brilliant_gallery_clean_table_image_arrays();
  }
}