1
0
Fork 0

write goroutine 제거

This commit is contained in:
Sangbum Kim 2018-07-10 02:42:20 +09:00
parent 17dcbac9ce
commit 8c1dcace29
1 changed files with 5 additions and 2 deletions

View File

@ -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