Skip to content

Add exponential backoff#134

Merged
f2prateek merged 3 commits into
segmentio:masterfrom
rohitpaulk:add-exponential-backoff
Dec 5, 2017
Merged

Add exponential backoff#134
f2prateek merged 3 commits into
segmentio:masterfrom
rohitpaulk:add-exponential-backoff

Conversation

@rohitpaulk

Copy link
Copy Markdown
Collaborator

This PR adds exponential backoff when requests are retried.

I picked the default backoff parameter values from https://github.com/segmentio/analytics-go and https://github.com/segmentio/backo-go.

@codecov-io

codecov-io commented Dec 5, 2017

Copy link
Copy Markdown

Codecov Report

Merging #134 into master will decrease coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
- Coverage   98.85%   98.74%   -0.11%     
==========================================
  Files          12       14       +2     
  Lines         612      799     +187     
==========================================
+ Hits          605      789     +184     
- Misses          7       10       +3
Impacted Files Coverage Δ
lib/segment/analytics/request.rb 100% <100%> (ø) ⬆️
lib/segment/analytics/defaults.rb 100% <100%> (ø) ⬆️
lib/segment/analytics/backoff_policy.rb 100% <100%> (ø)
spec/segment/analytics/request_spec.rb 100% <100%> (ø) ⬆️
spec/segment/analytics/client_spec.rb 98.1% <0%> (ø)

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 3281176...0c6ccdd. Read the comment docs.

PORT = 443
PATH = '/v1/import'
SSL = true
HEADERS = { :accept => 'application/json' }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this previously unused?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It was being assigned to a variable, but the actual headers used were hardcoded.

(The diff for this individual commit includes all the relevant files).

@f2prateek f2prateek merged commit 8cb8e9d into segmentio:master Dec 5, 2017
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