diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-09-12 17:35:46 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-09-12 17:35:46 +0100 |
| commit | 7dbdc5328e52846d3473ce18543fbd8eb4c7a91d (patch) | |
| tree | d32ce72d43aa0bb0a0c8b1e993c737c115c36b25 /src | |
| parent | a4a56513db8ffd999f34976cfe34dc4ca72d7c34 (diff) | |
| download | rabbitmq-server-git-7dbdc5328e52846d3473ce18543fbd8eb4c7a91d.tar.gz | |
pick the lowest between the message and queue TTL
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 66ffb1564c..38d85f7984 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -713,9 +713,11 @@ calculate_msg_expiry(#basic_message{content = Content}, TTL) -> #content{properties = Props} = rabbit_binary_parser:ensure_content_decoded(Content), %% We assert that the expiration must be valid - we check in che channel. - Milli = case rabbit_basic:parse_expiration(Props) of - {ok, undefined} -> TTL; - {ok, N } -> N + Milli = case {rabbit_basic:parse_expiration(Props), TTL} of + {{ok, undefined}, _ } -> TTL; + {{ok, N }, undefined} -> N; + {{ok, N }, M } when N < M -> N; + {{ok, N }, M } when M < N -> M end, case Milli of undefined -> undefined; |
