diff --git a/Gemfile b/Gemfile index 9e6d43ad8e3..a1406b87231 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,10 @@ gemspec gem 'jruby-openssl', :platforms => :jruby +gem 'legacy-retriable', + git: 'https://github.com/ProsperWorks/retriable', + ref: '9937072f73b7d9804a758fd99900bd683a6b2e72' + if ENV['RAILS_VERSION'] gem 'rails', ENV['RAILS_VERSION'] -end \ No newline at end of file +end diff --git a/google-api-client.gemspec b/google-api-client.gemspec index 03936cb5e35..aa8fd4e4257 100644 --- a/google-api-client.gemspec +++ b/google-api-client.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'autoparse', '~> 0.3' s.add_runtime_dependency 'extlib', '~> 0.9' s.add_runtime_dependency 'launchy', '~> 2.4' - s.add_runtime_dependency 'retriable', '~> 1.4' + s.add_runtime_dependency 'legacy-retriable', '1.4.2' s.add_runtime_dependency 'activesupport', '>= 3.2', '< 5.0' s.add_development_dependency 'rake', '~> 10.0' diff --git a/lib/legacy/google/api_client.rb b/lib/legacy/google/api_client.rb index 3162597024c..da9a34c6899 100644 --- a/lib/legacy/google/api_client.rb +++ b/lib/legacy/google/api_client.rb @@ -17,7 +17,7 @@ require 'multi_json' require 'compat/multi_json' require 'stringio' -require 'retriable' +require 'legacy/retriable' require 'legacy/google/api_client/version' require 'legacy/google/api_client/logging' @@ -635,7 +635,7 @@ def execute!(*params) tries = 1 + (options[:retries] || self.retries) attempt = 0 - Retriable.retriable :tries => tries, + Legacy::Retriable.legacy_retriable :tries => tries, :on => [TransmissionError], :on_retry => client_error_handler, :interval => lambda {|attempts| (2 ** attempts) + rand} do @@ -644,7 +644,7 @@ def execute!(*params) # This 2nd level retriable only catches auth errors, and supports 1 retry, which allows # auth to be re-attempted without having to retry all sorts of other failures like # NotFound, etc - Retriable.retriable :tries => ((expired_auth_retry || tries > 1) && attempt == 1) ? 2 : 1, + Legacy::Retriable.legacy_retriable :tries => ((expired_auth_retry || tries > 1) && attempt == 1) ? 2 : 1, :on => [AuthorizationError], :on_retry => authorization_error_handler(request.authorization) do result = request.send(connection, true)