-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry ES Calls using httpx #28
Conversation
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 77.36% 78.57% +1.20%
==========================================
Files 1 1
Lines 190 210 +20
==========================================
+ Hits 147 165 +18
- Misses 24 25 +1
- Partials 19 20 +1
Continue to review full report at Codecov.
|
indexer.go
Outdated
@@ -132,7 +165,7 @@ func CleanupIndexes(url string, alias string) error { | |||
func MakeJSONRequest(method string, url string, body string, jsonStruct interface{}) (*http.Response, error) { | |||
req, _ := http.NewRequest(method, url, bytes.NewReader([]byte(body))) | |||
req.Header.Add("Content-Type", "application/json") | |||
resp, err := http.DefaultClient.Do(req) | |||
resp, err := httpx.Do(http.DefaultClient, req, ElasticRetries(), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but now we're back to creating the retry config for every request 😄
my thinking was one global var called retryConfig
, initialize that in init()
and use it for all requests
haha whoops, ok now I know what you meant. |
@tybritten I've merged this and it's part of 5.7.1 but so is #29 which you can only run if your RapidPro instance is up to date with our 5.7 branch... we're making a lot of changes this week |
No description provided.