summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-02-12 17:46:50 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-02-12 17:46:50 +0000
commit214cb62d06a9aca9e1f6531404b403e8552fb5ae (patch)
tree1789d72baf22c20c432c4c2b33b62f0d5b054336 /src
parentd0bb738c7a499ad75f3fab54947ce01ce8397940 (diff)
downloadrabbitmq-server-git-214cb62d06a9aca9e1f6531404b403e8552fb5ae.tar.gz
optimise
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index fe3a609996..3bae4cfbb1 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -714,7 +714,13 @@ calculate_msg_expiry(#basic_message{content = Content}, TTL) ->
drop_expired_msgs(State = #q{backing_queue_state = BQS,
backing_queue = BQ }) ->
- Now = now_micros(),
+ case BQ:is_empty(BQS) of
+ true -> State;
+ false -> drop_expired_msgs(now_micros(), State)
+ end.
+
+drop_expired_msgs(Now, State = #q{backing_queue_state = BQS,
+ backing_queue = BQ }) ->
ExpirePred = fun (#message_properties{expiry = Exp}) -> Now >= Exp end,
{Props, State1} =
with_dlx(