From 39b489ba4c362997b41dd039971b8b510f6fe10d Mon Sep 17 00:00:00 2001 From: Holger Date: Sat, 2 Apr 2022 05:56:23 +0800 Subject: fix: `s3_force_single_request` not parsed (#17922) --- lib/paperclip/storage_extensions.rb | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 lib/paperclip/storage_extensions.rb (limited to 'lib') diff --git a/lib/paperclip/storage_extensions.rb b/lib/paperclip/storage_extensions.rb deleted file mode 100644 index 95c35641e..000000000 --- a/lib/paperclip/storage_extensions.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Some S3-compatible providers might not actually be compatible with some APIs -# used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822 -if ENV['S3_ENABLED'] == 'true' && ENV['S3_FORCE_SINGLE_REQUEST'] == 'true' - module Paperclip - module Storage - module S3Extensions - def copy_to_local_file(style, local_dest_path) - log("copying #{path(style)} to local file #{local_dest_path}") - s3_object(style).download_file(local_dest_path, { mode: 'single_request' }) - rescue Aws::Errors::ServiceError => e - warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}") - false - end - end - end - end - - Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions) -end -- cgit