about summary refs log tree commit diff
path: root/lib/paperclip
diff options
context:
space:
mode:
Diffstat (limited to 'lib/paperclip')
-rw-r--r--lib/paperclip/attachment_extensions.rb3
1 files changed, 3 insertions, 0 deletions
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)