[ARVADOS] updated: b40e379090ff9a01db439a7d4b3b2162d150f89a

git at public.curoverse.com git at public.curoverse.com
Wed Nov 19 00:19:09 EST 2014


Summary of changes:
 services/api/script/crunch-dispatch.rb | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

       via  b40e379090ff9a01db439a7d4b3b2162d150f89a (commit)
      from  9d4b0f36a978111fbd67fceb0ffb9e28d32aec14 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b40e379090ff9a01db439a7d4b3b2162d150f89a
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 19 00:19:10 2014 -0500

    4233: In crunch-dispatch, log timestamps in UTC in the same format crunch-job uses.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index ebd5165..d83485e 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -44,6 +44,12 @@ require File.dirname(__FILE__) + '/../config/boot'
 require File.dirname(__FILE__) + '/../config/environment'
 require 'open3'
 
+class LogTime < Time
+  def to_s
+    self.utc.strftime "%Y-%m-%d_%H:%M:%S"
+  end
+end
+
 class Dispatcher
   include ApplicationHelper
 
@@ -373,7 +379,7 @@ class Dispatcher
       end
 
       $stderr.puts "dispatch: job #{job.uuid}"
-      start_banner = "dispatch: child #{t.pid} start #{Time.now.ctime.to_s}"
+      start_banner = "dispatch: child #{t.pid} start #{LogTime.now}"
       $stderr.puts start_banner
 
       @running[job.uuid] = {
@@ -458,7 +464,7 @@ class Dispatcher
         if j[:log_throttle_bytes_skipped] > 0
           message = "#{job_uuid} ! Skipped #{j[:log_throttle_bytes_skipped]} bytes of log"
           $stderr.puts message
-          j[:stderr_buf_to_flush] << "#{Time.now.ctime.to_s} #{message}\n"
+          j[:stderr_buf_to_flush] << "#{LogTime.now} #{message}\n"
         end
 
         j[:log_throttle_reset_time] = now + Rails.configuration.crunch_log_throttle_period
@@ -526,7 +532,7 @@ class Dispatcher
           if rate_limit j, line
             $stderr.print "#{job_uuid} ! " unless line.index(job_uuid)
             $stderr.puts line
-            pub_msg = "#{Time.now.ctime.to_s} #{line.strip}\n"
+            pub_msg = "#{LogTime.now} #{line.strip}\n"
             j[:stderr_buf_to_flush] << pub_msg
           end
         end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list