From: Matt Mullins Date: Thu, 1 Sep 2011 05:23:32 +0000 (-0500) Subject: Fixed a bug caused by the Channel being killed out from under the AMQP module. RT... X-Git-Tag: v5~10 X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=e444b5bc77f5db7010051e301f15d91fb647ccf0;p=erlbot.git Fixed a bug caused by the Channel being killed out from under the AMQP module. RT ticket #73. --- diff --git a/amqp/amqp_bot_listener.erl b/amqp/amqp_bot_listener.erl index 0b54c34..bd8a934 100644 --- a/amqp/amqp_bot_listener.erl +++ b/amqp/amqp_bot_listener.erl @@ -18,11 +18,11 @@ %% Note this calls basic.consume with no_ack=true, so messages are %% automatically removed from the queue when they occur %% -%% This links the Channel to the current process so that it can handle, for +%% This monitors the Channel so that the calling process can handle, for %% instance, the AMQP server dying. listen_for_events(RoutingKeyString) -> {ok, Channel} = amqp_bot_connection:open_channel(), - link(Channel), + erlang:monitor(process, Channel), RoutingKeyBinary = list_to_binary(RoutingKeyString), Pid = self(), #'exchange.declare_ok'{} = amqp_channel:call(Channel,