Просмотр исходного кода

added a comment for non-obvious erlang:cancel_timer

Alex Kovalev 10 лет назад
Родитель
Сommit
817c6ed7c0
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      src/cowboy_clock.erl

+ 1 - 0
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),