summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hood <0x6e6562@gmail.com>2008-12-18 18:29:58 +0000
committerBen Hood <0x6e6562@gmail.com>2008-12-18 18:29:58 +0000
commit6c25cdcea5b0ab405d3ab160446784221533e802 (patch)
tree6c42a02946341a4b6cce92916d913f92ab5e5e70
parent7498967e007fdf8693aad6dd636e57aa5bf6d531 (diff)
downloadrabbitmq-server-6c25cdcea5b0ab405d3ab160446784221533e802.tar.gz
Don't double monitor anything
-rw-r--r--src/rabbit_limiter.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl
index 6cc170f9..0d938580 100644
--- a/src/rabbit_limiter.erl
+++ b/src/rabbit_limiter.erl
@@ -144,8 +144,11 @@ code_change(_, State, _) ->
% Starts to monitor a particular queue
monitor_queue(QPid, State = #lim{queues = Queues}) ->
- MonitorRef = erlang:monitor(process, QPid),
- State#lim{queues = dict:store(QPid, MonitorRef, Queues)}.
+ case dict:is_key(QPid, Queues) of
+ false -> MonitorRef = erlang:monitor(process, QPid),
+ State#lim{queues = dict:store(QPid, MonitorRef, Queues)};
+ true -> State
+ end.
% Stops monitoring a particular queue
demonitor_queue(QPid, State = #lim{queues = Queues}) ->