Merge commit 'f37dc6c59e88aa3a119ecbe76ee9fba480d13daa' into glitch-soc/merge-4.5

This commit is contained in:
Claire
2026-03-14 11:54:20 +01:00
6 changed files with 84 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
if ENV['SWIFT_ENABLED'] == 'true'
module PaperclipFogConnectionCache
def connection
@connection ||= begin
key = fog_credentials.hash
Thread.current[:paperclip_fog_connections] ||= {}
Thread.current[:paperclip_fog_connections][key] ||= ::Fog::Storage.new(fog_credentials)
end
end
end
Rails.application.config.after_initialize do
Paperclip::Storage::Fog.prepend(PaperclipFogConnectionCache)
end
end