fix bugs after refactoring

This commit is contained in:
Martin Geno 2016-10-04 14:54:19 +02:00
parent d2be435308
commit dfae737da3
2 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,7 @@ func (db *DB) worker() {
}
// write batch now?
if bp != nil && (writeNow || closed) || len(bp.Points()) >= batchMaxSize {
if bp != nil && (writeNow || closed || len(bp.Points()) >= batchMaxSize) {
log.Println("saving", len(bp.Points()), "points")
if err = db.client.Write(bp); err != nil {

View File

@ -45,6 +45,7 @@ func NewCollector(db *database.DB, nodes *models.Nodes, interval time.Duration,
collector := &Collector{
connection: conn,
db: db,
nodes: nodes,
multicastAddr: net.JoinHostPort(multiCastGroup+"%"+iface, port),
queue: make(chan *Response, 400),