summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Harrop <rharrop@vmware.com>2010-09-29 14:24:37 +0100
committerRob Harrop <rharrop@vmware.com>2010-09-29 14:24:37 +0100
commita7c396ebe6765458e7b1d04078cb65be81f0bb9f (patch)
tree4ee279febcac038790d7baf254152b589139f4ed
parent35810b9f5515c8a6e4ec88cca6825dae835de375 (diff)
downloadrabbitmq-server-git-a7c396ebe6765458e7b1d04078cb65be81f0bb9f.tar.gz
refactoring
-rw-r--r--src/rabbit_amqqueue_process.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index a92d136b7a..d4331cbb3f 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -590,14 +590,13 @@ msg_properties(State) ->
calculate_msg_expiry(_State = #q{ttl = undefined}) ->
undefined;
calculate_msg_expiry(_State = #q{ttl = Ttl}) ->
- Now = timer:now_diff(now(), {0,0,0}),
- Now + (Ttl * 1000).
+ now_millis() + (Ttl * 1000).
drop_expired_messages(State = #q{ttl = undefined}) ->
State;
drop_expired_messages(State = #q{backing_queue_state = BQS,
backing_queue = BQ}) ->
- Now = timer:now_diff(now(), {0,0,0}),
+ Now = now_millis(),
BQS1 = BQ:dropwhile(
fun (_MsgProperties = #msg_properties{expiry=Expiry}) ->
Now > Expiry
@@ -618,6 +617,9 @@ ensure_ttl_timer(State = #q{backing_queue = BQ,
end;
ensure_ttl_timer(State) ->
State.
+
+now_millis() ->
+ timer:now_diff(now(), {0,0,0}).
infos(Items, State) -> [{Item, i(Item, State)} || Item <- Items].