mirror of https://bitbucket.org/ausocean/av.git
revid: sendRetry check is now in if rather than loop
This commit is contained in:
parent
a726acf520
commit
6c29b362c9
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue