Permalink
Browse files

Fix AMQP daemon generator reconnect

  • Loading branch information...
1 parent 174c9e0 commit 88f10b9ac9fcb2ba92bbca2fd0db2b6a7a8b2ed4 @marcbowes marcbowes committed Apr 15, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
View
8 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
@@ -17,17 +17,15 @@
# daemon won't work as advertised.
# Run an event-loop for processing
-DaemonKit::AMQP.run do
+DaemonKit::AMQP.run do |connection|
# Inside this block we're running inside the reactor setup by the
# amqp gem. Any code in the examples (from the gem) would work just
# fine here.
# Uncomment this for connection keep-alive
- # AMQP.conn.connection_status do |status|
+ # connection.on_tcp_connection_loss do |client, settings|
# DaemonKit.logger.debug("AMQP connection status changed: #{status}")
- # if status == :disconnected
- # AMQP.conn.reconnect(true)
- # end
+ # client.reconnect(false, 1)
# end
amq = AMQP::Channel.new

0 comments on commit 88f10b9

Please sign in to comment.