Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Returns the correct err
Browse files Browse the repository at this point in the history
  • Loading branch information
jcooklin committed Dec 23, 2016
1 parent 9694f0d commit d22ff96
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions control/available_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ func (ap *availablePlugins) publishMetrics(metrics []core.Metric, pluginName str
pool.RLock()
defer pool.RUnlock()

p, err := pool.SelectAP(taskID, config)
if err != nil {
p, serr := pool.SelectAP(taskID, config)
if serr != nil {
return []error{serr}
}

Expand All @@ -463,9 +463,9 @@ func (ap *availablePlugins) publishMetrics(metrics []core.Metric, pluginName str
return []error{errors.New("unable to cast client to PluginPublisherClient")}
}

errp := cli.Publish(metrics, config)
if errp != nil {
return []error{errp}
err := cli.Publish(metrics, config)
if err != nil {
return []error{err}
}
p.(*availablePlugin).hitCount++
p.(*availablePlugin).lastHitTime = time.Now()
Expand Down

0 comments on commit d22ff96

Please sign in to comment.