oxy icon indicating copy to clipboard operation
oxy copied to clipboard

Buffer: retry request time interval

Open newsdy opened this issue 4 years ago • 3 comments

Can retry interval be configured? have this function?

newsdy avatar Dec 20 '19 09:12 newsdy

I also had this need. Added in #198.

dustin-decker avatar May 12 '20 22:05 dustin-decker

Can retry timeout be configured? Retry several times, if the limit timeout is exceeded, break the request。

chzhuo avatar May 21 '20 10:05 chzhuo

Yes, you can configure the interval with the option that I added, but otherwise you have the buffer expression to use:

	buffer.Retry(`IsNetworkError() && Attempts() <= 2`),
	buffer.RetrySleep(time.Second))

That would do up to two attempts, sleeping for one second in between. You can set a request timeout with a custom transport provided to the load balancer middleware.

dustin-decker avatar May 29 '20 23:05 dustin-decker