From 817c6ed7c06c4dbc96a9717b036e37e4dbf58c2b Mon Sep 17 00:00:00 2001 From: Alex Kovalev Date: Thu, 26 Mar 2015 12:55:42 +0300 Subject: added a comment for non-obvious erlang:cancel_timer --- src/cowboy_clock.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cowboy_clock.erl b/src/cowboy_clock.erl index 66fd5d4..c81b486 100644 --- a/src/cowboy_clock.erl +++ b/src/cowboy_clock.erl @@ -84,6 +84,7 @@ handle_cast(_Msg, State) -> -spec handle_info(any(), State) -> {noreply, State} when State::#state{}. handle_info(update, #state{universaltime=Prev, rfc1123=B1, tref=TRef0}) -> + %% Cancel the timer in case an external process sent an update message. erlang:cancel_timer(TRef0), T = erlang:universaltime(), B2 = update_rfc1123(B1, Prev, T), -- cgit v1.2.3