Closed doofdoofsf closed 8 years ago
@doofdoofsf great job! Couple of things before we can merge this in:
retries
. It now defaults to 3
, which may be undesirable for some people, especially with a progressive delay.OpenURI::HTTPError
by default is a good idea, since it might mean that the currency or exchange rate is not available (no retries would solve this).Anthony, thanks for the quick response.
It definitely needs some tests for the new stuff
Shame on me. I'll write some.
It should be possible to configure amount of retries. It now defaults to 3, which may be undesirable for some people, especially with a progressive delay.
Agreed. I'll do that.
don't think catching OpenURI::HTTPError by default is a good idea, since it might mean that the currency or exchange rate is not available (no retries would solve this).
I don't recall the category of problem that was generating this exception. I'll try taking it out and revisiting it. Perhaps we should make retry_exceptions
a configuration option too, defaulting to [Errno::ECONNREFUSED, Errno::ENETUNREACH]
?
I don't recall the category of problem that was generating this exception. I'll try taking it out and revisiting it. Perhaps we should make retry_exceptions a configuration option too, defaulting to [Errno::ECONNREFUSED, Errno::ENETUNREACH]?
Yeah, that should be great!
@doofdoofsf have you given up on this one? :)
@antstorm Well, kinda. I've been making much more extensive changes to the gem to increase reliability. Not clear to me if I should PR or just maintain our own private fork.
@doofdoofsf I'm more than happy to merge these in, I'm sure other devs would benefit from these changes as well
@antstorm thanks. let me see if i can grab some time to wrap things up and improve the test coverage etc. i agree others would benefit. our requests have been 100% reliable since the latest round of changes, which is nice.
@doofdoofsf sounds great! Ping me if you need any help with writing those tests and/or getting them to pass
https://www.google.com/finance/converter, has been quite flaky of late, commonly returning intermittent exceptions:
[Errno::ECONNREFUSED, OpenURI::HTTPError, Errno::ENETUNREACH]
This has been causing some pain for us.
This PR implements a simply retry. We've had this code running in production for over a month and seems to solve the problem completely. So far at least. It would be great to get this merged in if you like the direction.