avast/retry-go

Delay does not seems to be tacken into account

AlexandreRoba opened this issue · 3 comments

Hi,
I have the following code:

var eventPublisher *eventpublisher.EventPublisher
	err = retry.Do(func() error {
		eventPublisher, err = eventpublisher.NewEventPublisher(amqpURL, *amqpEventsExchange)
		if err != nil {
			return err
		}
		return nil
	},
		retry.Delay(5000*time.Second),
		retry.Attempts(30),
	)

I can indeed see 30 retries in the log but they all happen in the same second. Any idea?

Thks,
Alex

JaSei commented

Hi, thank you for your report. It's bug and will be fix today (#6)...

JaSei commented

fixed and released as 1.0.1

Excellent, I'll give it a try. thanks for the swift bug correction.