Closed darron closed 8 years ago
I added some suggestions. I think the idea is sound - the exponential backoff pattern is very common. There are some retry libraries out there that you could try, but I think a simple function is sufficient.
Thanks for the look @calebdoxsey - I have so much to learn around Go - appreciate the pointers. Will take a look at this tonight and see how I can tighten things up.
:+1:
Going to test in staging now.
The previous Consul connection logic was pretty weak - if it didn't connect on the first try for a Get/Set or Del it just failed. This one tries
consulTries
times over approximately 15 seconds - if it can't get a connection then there's likely something wrong - most Consul interruptions are 5-10 seconds at maximum.The called functions basically just wrap their counterpart with retry logic:
Get
callsconsulGet
Set
callsconsulSet
Del
callsconsulDel
You can see the logs in your local Console app:
http://shared.froese.org/2015/23c7l-10-30.jpg
To setup you need Go and a local installation of Consul:
I've been using Go 1.5.x - haven't tried it on Go 1.4.
First of all - is this sane?
Second - any big red flags?
Thanks @calebdoxsey