Kaynağa Gözat

Changed cron so it adds jobs rather than tries to run things. Some single functions just take too long

Stephen Ficklin 7 yıl önce
ebeveyn
işleme
3a28888edb

+ 7 - 3
tripal/tripal.module

@@ -1006,16 +1006,20 @@ function tripal_block_configure($delta = '') {
  * Implements hook_cron().
  */
 function tripal_cron() {
+
+  // Add jobs to the Tripal queue for commong tasks.
+  $args = array();
+
   if (variable_get('tripal_admin_notification_creation_during_cron', TRUE)) {
     $modules = module_implements('tripal_cron_notification');
     foreach ($modules as $module) {
       $function = $module . '_tripal_cron_notification';
-      $function();
+      tripal_add_job("Cron: Checking for '$module' notifications.", 'tripal', $function, $args, 1);
     }
-    watchdog('tripal_cron', 'tripal_cron ran');
   }
 
-  tripal_expire_collections();
+  // Check for expired collections.
+  tripal_add_job('Cron: Checking expired collections', 'tripal', 'tripal_expire_collections', $args, 1);
 }
 
 /**

+ 1 - 1
tripal/views_handlers/tripal_views_handler_area_collections.inc

@@ -69,7 +69,7 @@ function tripal_views_handler_area_collections_form($form, $form_state, $view, $
   $form['save_collection']['summary'] = array(
    '#type' => 'item',
    '#title' => 'Results Summary',
-   '#markup' => t('There are @total_rows record(s) that can be added to a container.', array('@total_rows' => $view->total_rows)),
+   '#markup' => t('There are @total_rows record(s) that can be added to a data collection.', array('@total_rows' => $view->total_rows)),
   );
   $form['save_collection']['collection_name'] = array(
    '#type' => 'textfield',