lib/refinery/queueable.rb in refinery-0.9.15 vs lib/refinery/queueable.rb in refinery-0.10.0
- old
+ new
@@ -7,27 +7,12 @@
def queue(name)
queue_provider.queue(name)
end
# Given the queue name and a block, yield the named queue into
- # the block. This method handles any exceptions that are raised
- # in the block and will recreate the provider automatically.
- #
- # Note that errors will not be propagated beyond this block. You
- # have been warned.
+ # the block.
def with_queue(name, &block)
- begin
- yield queue(name)
- rescue Exception => e
- logger.error "Queue error: #{e.message}"
- # this removes the sqs connection from the current thread.
- # note that this is brittle and will break if the RightAWS
- # library changes the name or the way the sqs connection is
- # stored in the thread local hash
- Thread.current[:sqs_connection] = nil
- sleep(5)
- retry
- end
+ yield queue(name)
end
protected
# Get the queue provider. Defaults to RightAws::SqsGen2 running
# in multi-thread mode.
\ No newline at end of file