You are here

function taxonomy_edge_cronapi in Taxonomy Edge 7

Same name and namespace in other branches
  1. 8 taxonomy_edge.module \taxonomy_edge_cronapi()
  2. 6 taxonomy_edge.module \taxonomy_edge_cronapi()

Implements hook_cronapi().

Regularly rebuild the edge list

File

./taxonomy_edge.module, line 182
Optimization of taxonomy data model for SQL performance.

Code

function taxonomy_edge_cronapi($op, $job = NULL) {
  switch ($op) {
    case 'list':
      return array(
        'taxonomy_edge_cron_rebuild' => 'Rebuild taxonomy edges',
        'taxonomy_edge_cron' => 'Resort invalid trees',
      );
    case 'rule':
      switch ($job) {
        case 'taxonomy_edge_cron_rebuild':
          return '0 2 * * *';
        case 'taxonomy_edge_cron':
          return '* * * * *';
      }
      break;
    case 'settings':
      switch ($job) {
        case 'taxonomy_edge_cron_rebuild':
          return array(
            'enabled' => FALSE,
          );
        case 'taxonomy_edge_cron':
          return array(
            'enabled' => TRUE,
          );
      }
      break;
  }
}