Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Commit

Permalink
Fix retry_codes when empty (#158)
Browse files Browse the repository at this point in the history
This fixes an issue where timeout wasn't being used.

[fixes #71]
  • Loading branch information
blowmage authored Apr 10, 2019
1 parent 4031be3 commit 81758b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/google/gax/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def initialize(timeout: 30, retry_options: nil, page_descriptor: nil,

# @return true when it has retry codes.
def retry_codes?
@retry_options && @retry_options.retry_codes
@retry_options &&
@retry_options.retry_codes &&
@retry_options.retry_codes.any?
end

# @return true when it has valid bundler configuration.
Expand Down
2 changes: 1 addition & 1 deletion spec/google/gax/api_callable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ module Gax
my_callable = Google::Gax.create_api_call(
func, CallSettings.new(timeout: 0, retry_options: retry_options)
)
expect { my_callable.call }.to raise_error(Google::Gax::RetryError)
expect { my_callable.call }.to raise_error(CustomException)
expect(call_count).to eq(1)
end

Expand Down

0 comments on commit 81758b0

Please sign in to comment.