summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_stats_aggregator.erl3
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}) ->