Skip to content
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

Merged
merged 5 commits into from
Aug 24, 2020
Merged

Conversation

tybritten
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2020

Codecov Report

Merging #28 into master will increase coverage by 1.20%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
indexer.go 78.57% <90.47%> (+1.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d85bf42...1c03e75. Read the comment docs.

indexer.go Outdated Show resolved Hide resolved
go.sum Show resolved Hide resolved
indexer.go Outdated Show resolved Hide resolved
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)
Copy link
Member

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

@tybritten
Copy link
Contributor Author

haha whoops, ok now I know what you meant.

@rowanseymour rowanseymour merged commit 60be9d6 into nyaruka:master Aug 24, 2020
@rowanseymour
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants