From 9d4861b4988e07636aa9c02f0732e8228791e9df Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 1 Jun 2022 19:23:31 +0200 Subject: Remove dependency on running Redis server for db:setup (#18560) --- lib/paperclip/attachment_extensions.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/paperclip/attachment_extensions.rb b/lib/paperclip/attachment_extensions.rb index 786f558e9..d66a17623 100644 --- a/lib/paperclip/attachment_extensions.rb +++ b/lib/paperclip/attachment_extensions.rb @@ -81,6 +81,9 @@ module Paperclip # to respond or don't respond at all and as such minimize the # impact of object storage outages on application throughput def save + # Don't go through Stoplight if we don't have anything object-storage-oriented to do + return super if @queued_for_delete.empty? && @queued_for_write.empty? && !dirty? + Stoplight('object-storage') { super }.with_threshold(STOPLIGHT_THRESHOLD).with_cool_off_time(STOPLIGHT_COOLDOWN).with_error_handler do |error, handle| if error.is_a?(Seahorse::Client::NetworkingError) handle.call(error) -- cgit