From 92dca43d2e4159b6a90116721eec80950207cc25 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 13 Aug 2012 15:13:48 +0100 Subject: don't re-schedule timer when the new timer would go off <1ms sooner ...since timer granularity is 1ms --- src/rabbit_amqqueue_process.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 283eba7c..66c90079 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -748,7 +748,7 @@ ensure_ttl_timer(Expiry, State = #q{ttl_timer_ref = undefined}) -> State#q{ttl_timer_ref = TRef, ttl_timer_expiry = Expiry}; ensure_ttl_timer(Expiry, State = #q{ttl_timer_ref = TRef, ttl_timer_expiry = TExpiry}) - when Expiry < TExpiry -> + when Expiry + 1000 < TExpiry -> case erlang:cancel_timer(TRef) of false -> State; _ -> ensure_ttl_timer(Expiry, State#q{ttl_timer_ref = undefined}) -- cgit v1.2.1