From 8c1dcace29278277a864433e82c716735a822880 Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Tue, 10 Jul 2018 02:42:20 +0900 Subject: [PATCH] =?UTF-8?q?write=20goroutine=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consumer/influx_stat.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/consumer/influx_stat.go b/consumer/influx_stat.go index d736327..47aebbb 100644 --- a/consumer/influx_stat.go +++ b/consumer/influx_stat.go @@ -13,9 +13,10 @@ import ( "sync/atomic" ) -func init(){ +func init() { influxmodels.EnableUintSupport() } + type processorData struct { Tempeture float64 FanSpeed int @@ -113,7 +114,7 @@ func (m *influxMetric) StartLogging() { case <-ticker: swapped := (*producer.OSMetricInfo)(atomic.SwapPointer(&osMetricPtr, nil)) copy(sendData, metricData) - go m.sendPoint(influxDbConn, sendData, swapped) + m.sendPoint(influxDbConn, sendData, swapped) case <-m.handler.Done(): return } @@ -138,6 +139,8 @@ func (m *influxMetric) sendPoint( Database: "core", Precision: "s", }) + batchPoint.SetWriteConsistency("consistency all") + if err != nil { m.logger.Warn(err) return