Skip to content
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
2 changes: 1 addition & 1 deletion lib/gooddata/helpers/global_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DeepMergeableHash < Hash
include Hashie::Extensions::DeepMerge
end

set_const :GD_MAX_RETRY, (ENV['GD_MAX_RETRY'] && ENV['GD_MAX_RETRY'].to_i) || 12
set_const :GD_MAX_RETRY, (ENV['GD_MAX_RETRY'] && ENV['GD_MAX_RETRY'].to_i) || 14
AES_256_CBC_CIPHER = 'aes-256-cbc'

class << self
Expand Down
4 changes: 2 additions & 2 deletions lib/gooddata/rest/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def generate_string(length = ID_LENGTH)

# Retry block if exception thrown
def retryable(options = {}, &_block)
opts = { :tries => 12, :on => RETRYABLE_ERRORS }.merge(options)
opts = { :tries => 14, :on => RETRYABLE_ERRORS }.merge(options)

retry_exception = opts[:on]
retries = opts[:tries]
Expand All @@ -118,9 +118,9 @@ def retryable(options = {}, &_block)
end
rescue RestClient::TooManyRequests, RestClient::ServiceUnavailable, *retry_exception => e
sleep retry_time
retry_time *= RETRY_TIME_COEFFICIENT
# Total 10 retry requests with 1.5 coefficent should take ~ 2 mins to finish
if (retries -= 1) > 0
retry_time *= RETRY_TIME_COEFFICIENT
retry
else
process_retry_error(e, retry_time)
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/rest/polling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
expect do
@client.get('/too_many_reqs')
end.to raise_error(RestClient::TooManyRequests)
expect(a_request(:get, "#{@server}/too_many_reqs")).to have_been_made.times(12)
expect(a_request(:get, "#{@server}/too_many_reqs")).to have_been_made.times(14)
end

it 'should make MAX_REQUESTS when hitting 503' do
expect do
@client.get('/out_of_service')
end.to raise_error(RestClient::ServiceUnavailable)
expect(a_request(:get, "#{@server}/out_of_service")).to have_been_made.times(12)
expect(a_request(:get, "#{@server}/out_of_service")).to have_been_made.times(14)
end

it 'should make 1 additional request when hitting 500' do
Expand Down
Loading