Log plugin errors in crankParallel and crankSeparate cases. Previously errors weren't logged in these cases.

This commit is contained in:
nickscript0 2015-08-22 14:03:30 -06:00 committed by Cameron Sparr
parent 9777aa6165
commit 1daa059ef9
1 changed files with 9 additions and 2 deletions

View File

@ -179,7 +179,11 @@ func (a *Agent) crankParallel() error {
acc.Prefix = plugin.name + "_"
acc.Config = plugin.config
plugin.plugin.Gather(&acc)
err := plugin.plugin.Gather(&acc)
if err != nil {
log.Printf("Error in plugins: %s", err)
}
points <- &acc
}(plugin)
@ -333,7 +337,10 @@ func (a *Agent) Run(shutdown chan struct{}) error {
wg.Add(1)
go func(plugin *runningPlugin) {
defer wg.Done()
a.crankSeparate(shutdown, plugin)
err := a.crankSeparate(shutdown, plugin)
if err != nil {
log.Printf("Error in plugins: %s", err)
}
}(plugin)
}
}