[ARVADOS] updated: 08913fc7a809d8138a1aeb11feaf1534fa6b6b43

git at public.curoverse.com git at public.curoverse.com
Tue Feb 11 12:52:33 EST 2014


Summary of changes:
 services/api/app/models/job.rb |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

       via  08913fc7a809d8138a1aeb11feaf1534fa6b6b43 (commit)
      from  bd8c639ce45ee7b945c92b6492b4c05492f7a091 (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 08913fc7a809d8138a1aeb11feaf1534fa6b6b43
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Feb 11 09:52:07 2014 -0800

    Return log buffer "(not available)" instead of crashing if redis is down.

diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index 5ea0cd4..f32f001 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -168,9 +168,13 @@ class Job < ArvadosModel
   end
 
   def log_buffer
-    @@redis ||= Redis.new(:timeout => 0)
-    if @@redis.exists uuid
-      @@redis.getrange(uuid, 0 - 2**10, -1)
+    begin
+      @@redis ||= Redis.new(:timeout => 0)
+      if @@redis.exists uuid
+        @@redis.getrange(uuid, 0 - 2**10, -1)
+      end
+    rescue Redis::CannotConnectError
+      return '(not available)'
     end
   end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list