X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/681496f40864418fc1ee46277941a40d3445107c..546b44cf5dfba972d2f5f91fa4434e9cb64fa0cd:/services/api/app/models/blob.rb diff --git a/services/api/app/models/blob.rb b/services/api/app/models/blob.rb index 5decd77261..7d16048bf8 100644 --- a/services/api/app/models/blob.rb +++ b/services/api/app/models/blob.rb @@ -1,5 +1,13 @@ class Blob + def initialize locator + @locator = locator + end + + def empty? + !!@locator.match(/^d41d8cd98f00b204e9800998ecf8427e(\+.*)?$/) + end + # In order to get a Blob from Keep, you have to prove either # [a] you have recently written it to Keep yourself, or # [b] apiserver has recently decided that you should be able to read it @@ -35,7 +43,7 @@ class Blob end timestamp = opts[:expire] else - timestamp = Time.now.to_i + (opts[:ttl] || 600) + timestamp = Time.now.to_i + (opts[:ttl] || 1209600) end timestamp_hex = timestamp.to_s(16) # => "53163cb4"