lib/s3repo/cache.rb in s3repo-2.0.3 vs lib/s3repo/cache.rb in s3repo-3.0.1
- old
+ new
@@ -5,11 +5,11 @@
module S3Repo
##
# Cache object, stores S3 objects on disk
class Cache < Base
TMPDIRS = [
- ENV['TMPDIR'],
+ ENV.fetch('TMPDIR', nil),
Dir.tmpdir,
'/tmp/s3repo'
].freeze
def initialize(params = {})
@@ -39,11 +39,10 @@
def get_object(key, path)
FileUtils.mkdir_p File.dirname(path)
object = atomic_get_object(key, path)
etags[key] = object.etag
- rescue Aws::S3::Errors::NotModified
- return
+ rescue Aws::S3::Errors::NotModified # rubocop:disable Lint/SuppressedException
end
def atomic_get_object(key, path)
tmpfile = Tempfile.create(key, partialdir)
object = client.get_object(