init repeater in send loop

This commit is contained in:
Umputun
2018-11-12 02:10:22 -06:00
parent 30225e0fd0
commit cbb534d2df
+1 -1
View File
@@ -89,11 +89,11 @@ func (s *Service) Close() {
}
func (s *Service) do() {
rpt := repeater.New(strategy.NewBackoff(5, 1.5, true))
for c := range s.queue {
var wg sync.WaitGroup
for _, dest := range s.destinations {
wg.Add(1)
rpt := repeater.New(strategy.NewBackoff(5, 1.5, true))
go func(d Destination) {
err := rpt.Do(func() error {
return d.Send(s.ctx, c)