diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-11-03 19:15:40 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-11-03 19:15:40 +0000 |
commit | f2689f944e1c0f573afe4393ff26bbc988db8baf (patch) | |
tree | f83cfd25316dc3eb558af091e14ee7bfa2293a34 /src/couchdb/couch_stats_aggregator.erl | |
parent | 6943c2f9d7117b7e15090bf7ea86bc18d2bd8a85 (diff) |
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
Diffstat (limited to 'src/couchdb/couch_stats_aggregator.erl')
-rw-r--r-- | src/couchdb/couch_stats_aggregator.erl | 3 |
1 files changed, 2 insertions, 1 deletions
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}) -> |