From f2689f944e1c0f573afe4393ff26bbc988db8baf Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Tue, 3 Nov 2009 19:15:40 +0000 Subject: only 1 timer at a time (e.g. flush/1). thanks tisba for the report. COUCHDB-539 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@832519 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_stats_aggregator.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/couchdb/couch_stats_aggregator.erl b/src/couchdb/couch_stats_aggregator.erl index 2f5c6d13..d067f354 100644 --- a/src/couchdb/couch_stats_aggregator.erl +++ b/src/couchdb/couch_stats_aggregator.erl @@ -122,7 +122,8 @@ terminate(_Reason, {TRef, _Rate}) -> timer:cancel(TRef), ok. -handle_call(collect_sample, _, {_TRef, SampleInterval}) -> +handle_call(collect_sample, _, {OldTRef, SampleInterval}) -> + timer:cancel(OldTRef), {ok, TRef} = timer:apply_after(SampleInterval, ?MODULE, collect_sample, []), % Gather new stats values to add. Incs = lists:map(fun({Key, Value}) -> -- cgit v1.2.3