diff options
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 2cf3e9f125..b52d221358 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -719,6 +719,9 @@ calculate_msg_expiry(#basic_message{content = Content}, TTL) -> T -> now_micros() + T * 1000 end. +drop_expired_messages(State = #q{ttl = undefined, + ttl_timer_ref = undefined}) -> + State; drop_expired_messages(State = #q{backing_queue_state = BQS, backing_queue = BQ }) -> Now = now_micros(), @@ -737,7 +740,8 @@ drop_expired_messages(State = #q{backing_queue_state = BQS, ensure_ttl_timer(case Props of undefined -> undefined; #message_properties{expiry = Exp} -> Exp - end, State#q{backing_queue_state = BQS1}). + end, State#q{backing_queue_state = BQS1, + ttl_timer_ref = undefined}). ensure_ttl_timer(undefined, State) -> State; @@ -1321,7 +1325,7 @@ handle_info(maybe_expire, State) -> end; handle_info(drop_expired, State) -> - noreply(drop_expired_messages(State#q{ttl_timer_ref = undefined})); + noreply(drop_expired_messages(State)); handle_info(emit_stats, State) -> %% Do not invoke noreply as it would see no timer and create a new one. |
