fix: collector crash without db

This commit is contained in:
Martin Geno 2016-10-18 22:54:26 +02:00
parent 38f32952c2
commit 0c18f402a0

View File

@ -98,7 +98,9 @@ func (coll *Collector) sender() {
return
case <-coll.ticker.C:
// save global statistics
coll.db.AddPoint(database.MeasurementGlobal, nil, coll.nodes.GlobalStats().Fields(), time.Now())
if coll.db != nil {
coll.db.AddPoint(database.MeasurementGlobal, nil, coll.nodes.GlobalStats().Fields(), time.Now())
}
// send the multicast packet to request per-node statistics
coll.sendOnce()