Fix output panic for -test flag
This commit is contained in:
parent
891f3af504
commit
2f08577967
12
agent.go
12
agent.go
|
@ -271,7 +271,17 @@ func (a *Agent) Test() error {
|
|||
defer close(shutdown)
|
||||
pointChan := make(chan *client.Point)
|
||||
|
||||
go a.flusher(shutdown, pointChan)
|
||||
// dummy receiver for the point channel
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-pointChan:
|
||||
// do nothing
|
||||
case <-shutdown:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
for _, plugin := range a.plugins {
|
||||
acc := NewAccumulator(plugin.config, pointChan)
|
||||
|
|
Loading…
Reference in New Issue