Browse Source

Fixed bug with jobs and removed all dpms

Stephen Ficklin 8 years ago
parent
commit
67f13d157e

+ 1 - 1
legacy/tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -215,7 +215,7 @@ function chado_analysis_form($node, &$form_state) {
   $day = preg_replace("/^\d+-\d+-0?(\d+) .*/", "$1", $default_time);
   // If the time is not set, use current time
   if (!$default_time) {
-    $default_time = REQUEST_TIME;
+    $default_time = time();
     $year  = format_date($default_time, 'custom', 'Y');
     $month = format_date($default_time, 'custom', 'n');
     $day   = format_date($default_time, 'custom', 'j');

+ 5 - 5
tripal/api/tripal.jobs.api.inc

@@ -126,7 +126,7 @@ function tripal_add_job($job_name, $modulename, $callback, $arguments, $uid,
     'modulename' => $modulename,
     'callback' => $callback,
     'status' => 'Waiting',
-    'submit_date' => REQUEST_TIME,
+    'submit_date' => time(),
     'uid' => $uid,
     # The lower the number the higher the priority.
     'priority' => $priority,
@@ -212,7 +212,7 @@ function tripal_is_job_running() {
       // the job is not running so terminate it
       $record = new stdClass();
       $record->job_id = $job->job_id;
-      $record->end_time = REQUEST_TIME;
+      $record->end_time = time();
       $record->status = 'Error';
       $record->error_msg = 'Job has terminated unexpectedly.';
       drupal_write_record('tripal_jobs', $record, 'job_id');
@@ -286,7 +286,7 @@ function tripal_cancel_job($job_id, $redirect = TRUE) {
   if ($job->start_time == 0) {
     $record = new stdClass();
     $record->job_id = $job->job_id;
-    $record->end_time = REQUEST_TIME;
+    $record->end_time = time();
     $record->status = 'Cancelled';
     $record->progress = '0';
     drupal_write_record('tripal_jobs', $record, 'job_id');
@@ -352,7 +352,7 @@ function tripal_launch_job($do_parallel = 0, $job_id = NULL) {
     // set the start time for this job
     $record = new stdClass();
     $record->job_id = $job->job_id;
-    $record->start_time = REQUEST_TIME;
+    $record->start_time = time();
     $record->status = 'Running';
     $record->pid = getmypid();
     drupal_write_record('tripal_jobs', $record, 'job_id');
@@ -391,7 +391,7 @@ function tripal_launch_job($do_parallel = 0, $job_id = NULL) {
     print "Calling: $callback(" . implode(", ", $string_args) . ")\n";
     call_user_func_array($callback, $args);
     // set the end time for this job
-    $record->end_time = REQUEST_TIME;
+    $record->end_time = time();
     $record->status = 'Completed';
     $record->progress = '100';
     drupal_write_record('tripal_jobs', $record, 'job_id');

+ 1 - 1
tripal_chado/api/tripal_chado.mviews.api.inc

@@ -364,7 +364,7 @@ function tripal_populate_mview($mview_id) {
         $count = $results->fetchObject();
         $record = new stdClass();
         $record->mview_id = $mview_id;
-        $record->last_update = REQUEST_TIME;
+        $record->last_update = time();
         $record->status = "Populated with " . number_format($count->cnt) . " rows";
         drupal_write_record('tripal_mviews', $record, 'mview_id');
       }

+ 1 - 1
tripal_chado/includes/loaders/tripal_chado.pub_importer_PMID.inc

@@ -144,7 +144,7 @@ function tripal_pub_remote_search_PMID($search_array, $num_to_retrieve, $page) {
   }
   if ($days) {
     // get the date of the day suggested
-    $past_timestamp = REQUEST_TIME - ($days * 86400);
+    $past_timestamp = time() - ($days * 86400);
     $past_date = getdate($past_timestamp);
     $search_str .= " AND (\"" . sprintf("%04d/%02d/%02d", $past_date['year'], $past_date['mon'], $past_date['mday']) . "\"[Date - Create] : \"3000\"[Date - Create]))";
   }

+ 1 - 1
tripal_chado/includes/tripal_chado.field_storage.inc

@@ -415,7 +415,7 @@ function tripal_chado_field_storage_write_merge_fields($fields, $entity_type, $e
  * Implements hook_field_storage_query().
  */
 function tripal_chado_field_storage_query($query) {
-dpm($query);
+
   // Initialize the result array.
   $result = array(
     'TripalEntity' => array()