revid: sendRetry check is now in if rather than loop

This commit is contained in:
Saxon 2019-03-12 09:45:00 +10:30
parent a726acf520
commit 6c29b362c9
1 changed files with 11 additions and 9 deletions

View File

@ -75,16 +75,18 @@ func (s *multiSender) Write(d []byte) (int, error) {
if err != nil {
s.owner.config.Logger.Log(logger.Warning, "send failed", "output", i, "error", err)
s.handleFail(sender, err)
for s.owner.config.SendRetry {
if !s.owner.IsRunning() {
sender.release()
return 0, err
if s.owner.config.SendRetry {
for {
if !s.owner.IsRunning() {
sender.release()
return 0, err
}
err = sender.send()
if err == nil {
break
}
s.handleFail(sender, err)
}
err = sender.send()
if err == nil {
break
}
s.handleFail(sender, err)
}
}
sender.release()