Sha256: 326dcb2753fca07f04208bc51095ea9f4b351d218831f98e01ee9ec51022114f

Contents?: true

Size: 580 Bytes

Versions: 22

Compression:

Stored size: 580 Bytes

Contents

module Shoryuken
  module Middleware
    module Server
      class AutoDelete
        def call(worker, queue, sqs_msg, body)
          yield

          auto_delete = worker.class.get_shoryuken_options['delete'] || worker.class.get_shoryuken_options['auto_delete']

          if auto_delete
            entries = [sqs_msg].flatten.map.with_index do |message, i|
              { id: i.to_s, receipt_handle: message.receipt_handle }
            end

            Shoryuken::Client.queues(queue).delete_messages(entries: entries)
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shoryuken-3.0.7 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.6 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.5 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.4 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.3 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.2 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.1 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-3.0.0 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.1.3 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.1.2 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.1.1 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.1.0 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.11 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.4 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.3 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.2 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.1 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-2.0.0 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-1.0.3 lib/shoryuken/middleware/server/auto_delete.rb
shoryuken-1.0.2 lib/shoryuken/middleware/server/auto_delete.rb