lib/smart_que/consumers/base.rb in smart-que-0.2.3 vs lib/smart_que/consumers/base.rb in smart-que-0.2.4
- old
+ new
@@ -23,10 +23,14 @@
::SmartQue.establish_connection
end
# Create channel with the established connection.
def channel
- @channel ||= connection.create_channel
+ # Create new channel if closed
+ if @channel.nil? || @channel.closed?
+ @channel = connection.create_channel
+ end
+ @channel
end
def config
::SmartQue.config
end