diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2010-09-13 18:00:07 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2010-09-13 18:00:07 +0100 |
commit | 833d65afe865c0fc54051de665b870af197357af (patch) | |
tree | 736a0dbc3c29f28d08d6ac6ce65c246c27ed68da | |
parent | 9227d5e7248999a8a5a42f01a5f65d8aefa0e0a5 (diff) | |
download | rabbitmq-server-833d65afe865c0fc54051de665b870af197357af.tar.gz |
Only emit stats in state running, so we don't emit stats before the connection event in the case of a slow connection startup.
-rw-r--r-- | src/rabbit_reader.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 795a2a92..dc94a83c 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -690,11 +690,14 @@ refuse_connection(Sock, Exception) -> ok = inet_op(fun () -> rabbit_net:send(Sock, <<"AMQP",0,0,9,1>>) end), throw(Exception). -ensure_stats_timer(State = #v1{stats_timer = StatsTimer}) -> +ensure_stats_timer(State = #v1{stats_timer = StatsTimer, + connection_state = running}) -> Self = self(), State#v1{stats_timer = rabbit_event:ensure_stats_timer_after( StatsTimer, - fun() -> emit_stats(Self) end)}. + fun() -> emit_stats(Self) end)}; +ensure_stats_timer(State) -> + State. %%-------------------------------------------------------------------------- |