You are here

brilliant_gallery_cron.inc in Brilliant Gallery 7.2

Same filename and directory in other branches
  1. 7 brilliant_gallery_cron.inc

File

brilliant_gallery_cron.inc
View source
<?php

/*
 * Recursively read all gallery images and repopulate table brilliant_gallery_sources.
 */
function brilliant_gallery_cronapi($op, $job = NULL) {
  $items['brilliant_gallery_getbgfiles'] = array(
    'description' => 'Recursively read all images under the Brilliant Gallery root folder and update database table brilliant_gallery_sources',
    'rule' => '0 0 * * *',
  );

  //$items['example_news_cron'] = array(

  //'description' => 'Send mail with news',

  //'rule' => '*/5 * * * *', // Every 5 minutes

  // i must call: example_news_fetch('all')

  //'callback' => 'example_news_fetch',

  //'arguments' => array('all'),

  //);
  return $items;
}

// @TODO may be necessary to use hook_cron instead of just hook_cronapi???

/**
 * @todo Please document this function.
 * @see http://drupal.org/node/1354
 */

/*
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 (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();
  }
}
*/

Functions