Trap exits in a converted irc_amqp_listener. v10
authorMatt Mullins <mmullins@mmlx.us>
Sun, 5 May 2013 06:56:00 +0000 (23:56 -0700)
committerMatt Mullins <mmullins@mmlx.us>
Sun, 5 May 2013 07:36:00 +0000 (00:36 -0700)
Without this, an upgraded irc_amqp_listener still won't manage to terminate cleanly.

On the other hand, it doesn't anyway -- it's still brutal_kill'ed.  Drop this patch, maybe?

irc/irc_amqp_listener.erl

index 785660f..ffcfcfd 100644 (file)
@@ -65,6 +65,7 @@ handle_info(
 code_change(2, {ConnectionPid}, _) ->
     case process_info(self(), monitors) of
         {monitors, [{process, ListeningChannel}]} ->
+            process_flag(trap_exit, true),
             {ok, {ConnectionPid, ListeningChannel}};
         _ ->
             {error, cant_find_listening_channel}