From a6cbce0d3ee6a90d42817c42ec3ce90be43f2d43 Mon Sep 17 00:00:00 2001 From: Lyon Hill Date: Mon, 2 Oct 2017 11:41:03 -0600 Subject: [PATCH] fix issues brought up by joe --- tsdb/batcher.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tsdb/batcher.go b/tsdb/batcher.go index c45e45d000..45e6fd03ea 100644 --- a/tsdb/batcher.go +++ b/tsdb/batcher.go @@ -56,13 +56,17 @@ func (b *PointBatcher) Start() { } // initialize the timer variable - timer := &time.NewTimer(b.duration) + timer := time.NewTimer(time.Hour) timer.Stop() var batch []models.Point emit := func() { timer.Stop() + select { + case <-timer.C: + default: + } // Nothing batched? if len(batch) == 0 {