[ARVADOS] updated: 610d9aea55464f9bde956c8df7c97a4a2103e738

git at public.curoverse.com git at public.curoverse.com
Mon Mar 16 12:22:28 EDT 2015


Summary of changes:
 services/api/app/models/blob.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

       via  610d9aea55464f9bde956c8df7c97a4a2103e738 (commit)
      from  68483f1bc4d5d170471d02a60cebc28e794501b2 (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 610d9aea55464f9bde956c8df7c97a4a2103e738
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Mon Mar 16 12:21:34 2015 -0400

    5383: blob.rb uses db_current_time as well. since it is using static methods, the module needs to be "extended"

diff --git a/services/api/app/models/blob.rb b/services/api/app/models/blob.rb
index 7d16048..799279d 100644
--- a/services/api/app/models/blob.rb
+++ b/services/api/app/models/blob.rb
@@ -1,4 +1,5 @@
 class Blob
+  extend DbCurrentTime
 
   def initialize locator
     @locator = locator
@@ -43,7 +44,7 @@ class Blob
       end
       timestamp = opts[:expire]
     else
-      timestamp = Time.now.to_i + (opts[:ttl] || 1209600)
+      timestamp = db_current_time.to_i + (opts[:ttl] || 1209600)
     end
     timestamp_hex = timestamp.to_s(16)
     # => "53163cb4"
@@ -90,7 +91,7 @@ class Blob
     if !timestamp.match /^[\da-f]+$/
       raise Blob::InvalidSignatureError.new 'Timestamp is not a base16 number.'
     end
-    if timestamp.to_i(16) < Time.now.to_i
+    if timestamp.to_i(16) < db_current_time.to_i
       raise Blob::InvalidSignatureError.new 'Signature expiry time has passed.'
     end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list