1
0
Fork 0

nil 오류 수정

This commit is contained in:
Sangbum Kim 2017-09-12 21:49:48 +09:00
parent abe19350f5
commit fc407c6be3
1 changed files with 2 additions and 3 deletions

View File

@ -46,7 +46,6 @@ func (m *influxMetric) StartLogging() {
defer func() { defer func() {
if err := recover(); err != nil { if err := recover(); err != nil {
influxLogger.Errorf("ERR:%s", debug.Stack())
m.handler.NotifyError(err.(error)) m.handler.NotifyError(err.(error))
} }
}() }()
@ -83,7 +82,7 @@ func (m *influxMetric) StartLogging() {
panic(err) panic(err)
} }
ticker := time.Tick(time.Second) ticker := time.Tick(time.Second)
pointList := make([]*client.Point, 0) pointList := make([]*client.Point, 0, 0)
for { for {
pointList = pointList[:cap(pointList)] pointList = pointList[:cap(pointList)]
@ -113,7 +112,7 @@ func (m *influxMetric) StartLogging() {
if err := influxDbConn.Write(batchPoint); err != nil { if err := influxDbConn.Write(batchPoint); err != nil {
influxLogger.Warn(err) influxLogger.Warn(err)
} }
pointList = pointList[:0] pointList = make([]*client.Point, 0, 0)
} }
} }