summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-10-22 15:49:45 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-10-22 15:49:45 +0100
commit2816ffa027a523a9ff2de052cb834a706e8068c5 (patch)
tree495a68cd68619d8783fbf858342c38fb966b13dd
parentb2bf2f24d1d4f22a35ba38bc689b0a387d106cad (diff)
parenteeb7907e734f4cbbf43bc6dfcd01a1615fe48558 (diff)
downloadrabbitmq-server-2816ffa027a523a9ff2de052cb834a706e8068c5.tar.gz
Merging bug23111 to default (again)
-rw-r--r--src/rabbit_amqqueue_process.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index a2fab54c..e9b70a8f 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -162,7 +162,7 @@ init_expires(State = #q{q = #amqqueue{arguments = Arguments}}) ->
init_ttl(State = #q{q = #amqqueue{arguments = Arguments}}) ->
case rabbit_misc:table_lookup(Arguments, <<"x-message-ttl">>) of
- {_Type, TTL} -> State#q{ttl = TTL};
+ {_Type, TTL} -> drop_expired_messages(State#q{ttl = TTL});
undefined -> State
end.
@@ -858,11 +858,11 @@ handle_call({basic_cancel, ChPid, ConsumerTag, OkMsg}, _From,
end
end;
-handle_call(stat, _From, State = #q{backing_queue = BQ,
- backing_queue_state = BQS,
- active_consumers = ActiveConsumers}) ->
- reply({ok, BQ:len(BQS), queue:len(ActiveConsumers)},
- ensure_expiry_timer(State));
+handle_call(stat, _From, State) ->
+ State1 = #q{backing_queue = BQ, backing_queue_state = BQS,
+ active_consumers = ActiveConsumers} =
+ drop_expired_messages(ensure_expiry_timer(State)),
+ reply({ok, BQ:len(BQS), queue:len(ActiveConsumers)}, State1);
handle_call({delete, IfUnused, IfEmpty}, _From,
State = #q{backing_queue_state = BQS, backing_queue = BQ}) ->