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

Increase delay between request retry to Knapsack Pro API #99

Merged
merged 2 commits into from
Feb 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

### Unreleased

* Increase delay between request retry to Knapsack Pro API from 2s to 4s for 2nd request and from 4s to 8s for 3rd request

https://github.com/KnapsackPro/knapsack_pro-ruby/pull/99

### 1.17.0

* Add `KNAPSACK_PRO_CUCUMBER_QUEUE_PREFIX` to allow run Cucumber with spring gem in Queue Mode
Expand Down
2 changes: 1 addition & 1 deletion lib/knapsack_pro/client/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ServerError < StandardError; end

TIMEOUT = 15
MAX_RETRY = 3
REQUEST_RETRY_TIMEBOX = 2
REQUEST_RETRY_TIMEBOX = 4

def initialize(action)
@action = action
Expand Down
4 changes: 2 additions & 2 deletions spec/knapsack_pro/client/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@
server_error = described_class::ServerError.new(parsed_response)
expect(logger).to receive(:warn).exactly(3).with(server_error.inspect)

expect(logger).to receive(:warn).with("Wait 2s and retry request to Knapsack Pro API.")
expect(logger).to receive(:warn).with("Wait 4s and retry request to Knapsack Pro API.")
expect(Kernel).to receive(:sleep).with(2)
expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
expect(Kernel).to receive(:sleep).with(4)
expect(Kernel).to receive(:sleep).with(8)

expect(subject).to eq(parsed_response)

Expand Down