fix bugs after refactoring
This commit is contained in:
parent
d2be435308
commit
dfae737da3
@ -105,7 +105,7 @@ func (db *DB) worker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write batch now?
|
// 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")
|
log.Println("saving", len(bp.Points()), "points")
|
||||||
|
|
||||||
if err = db.client.Write(bp); err != nil {
|
if err = db.client.Write(bp); err != nil {
|
||||||
|
@ -45,6 +45,7 @@ func NewCollector(db *database.DB, nodes *models.Nodes, interval time.Duration,
|
|||||||
|
|
||||||
collector := &Collector{
|
collector := &Collector{
|
||||||
connection: conn,
|
connection: conn,
|
||||||
|
db: db,
|
||||||
nodes: nodes,
|
nodes: nodes,
|
||||||
multicastAddr: net.JoinHostPort(multiCastGroup+"%"+iface, port),
|
multicastAddr: net.JoinHostPort(multiCastGroup+"%"+iface, port),
|
||||||
queue: make(chan *Response, 400),
|
queue: make(chan *Response, 400),
|
||||||
|
Loading…
Reference in New Issue
Block a user