zuora_api 1.6.18 → 1.6.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde9d48ecb8183a809d7e461374871cb29ac822f
4
- data.tar.gz: 4f0493a78076b964141587055532e003757a013b
3
+ metadata.gz: d1fc5fd80b603068e7275109a79cf583be06a555
4
+ data.tar.gz: 14e5d8ba42672c04efa2bd1b6d66f7e7adb703d2
5
5
  SHA512:
6
- metadata.gz: f383c511e9ea580b74589341f9d69ad4e6303b55a888ca63cc75566024ebc55eba6cd87df782f1bb99b079d9caf76e7edb424a3564e416135a34e2d20e986953
7
- data.tar.gz: 4f998b30cf6cb7265676ed00bcf69782a5eb5222a2162a29a1ef335d671dbaa73a0f17217b7d975854888f5955d137f239acd8e6cf41d08c729c8dd396d50a8c
6
+ metadata.gz: bf8783fdd21fb1d7374bd44b96841f1f36e43b42537b15a17aef6e67b7b2ddad6808acfb5bcbee0a30ff8775cbdf67b9b3b60abce14c3be830357c4fc092e503
7
+ data.tar.gz: e7f594df58d83af49f7a308d66fd09632bcd45f058142da7e5a167aa2ca969591dfa903aa40e45159c57c1f67d03d94a4056a543bd312544304933d18642998a
@@ -8,6 +8,9 @@ module ZuoraAPI
8
8
  REGIONS = [EU = 'EU', US = 'US', NA = 'NA' ]
9
9
  MIN_Endpoint = '91.0'
10
10
  XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
11
+ CONNECTION_EXCEPTIONS = [Net::OpenTimeout, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError]
12
+ CONNECTION_READ_EXCEPTIONS = [Net::ReadTimeout, Errno::ECONNRESET, Errno::EPIPE]
13
+
11
14
  attr_accessor :region, :url, :wsdl_number, :current_session, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name, :entity_id, :timeout_sleep, :hostname, :zconnect_provider
12
15
 
13
16
  def initialize(url: nil, entity_id: nil, session: nil, status: nil, **keyword_args)
@@ -437,7 +440,15 @@ module ZuoraAPI
437
440
  else
438
441
  return output_xml, input_xml, response
439
442
  end
440
- rescue Net::OpenTimeout, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError => ex
443
+ rescue *CONNECTION_EXCEPTIONS => ex
444
+ if !(tries -= 1).zero?
445
+ Rails.logger.info("SOAP Call - #{ex.class} Timed out will retry after 5 seconds")
446
+ sleep(self.timeout_sleep)
447
+ retry
448
+ else
449
+ raise ex
450
+ end
451
+ rescue *CONNECTION_READ_EXCEPTIONS => ex
441
452
  if !(tries -= 1).zero? && timeout_retry
442
453
  Rails.logger.info("SOAP Call - #{ex.class} Timed out will retry after 5 seconds")
443
454
  sleep(self.timeout_sleep)
@@ -686,7 +697,7 @@ module ZuoraAPI
686
697
  end
687
698
  des_hash[:related_objects] = output_xml.xpath(".//related-objects").xpath(".//object").map{ |x| [x.xpath(".//name").text.to_sym, [ [:url, x.attributes["href"].value], [:label, x.xpath(".//name").text ] ].to_h] }.to_h
688
699
  end
689
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError => ex
700
+ rescue *(CONNECTION_EXCEPTIONS).concat(CONNECTION_READ_EXCEPTIONS) => ex
690
701
  if !(tries -= 1).zero?
691
702
  Rails.logger.info("Describe - #{ex.class} Timed out will retry after 5 seconds")
692
703
  sleep(self.timeout_sleep)
@@ -758,7 +769,15 @@ module ZuoraAPI
758
769
  end
759
770
  rescue ZuoraAPI::Exceptions::BadEntityError => ex
760
771
  raise ex
761
- rescue Net::OpenTimeout, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError => ex
772
+ rescue *CONNECTION_EXCEPTIONS => ex
773
+ if !(tries -= 1).zero?
774
+ Rails.logger.info("Rest Call - #{ex.class} Timed out will retry after 5 seconds")
775
+ sleep(self.timeout_sleep)
776
+ retry
777
+ else
778
+ raise ex
779
+ end
780
+ rescue *CONNECTION_READ_EXCEPTIONS => ex
762
781
  if !(tries -= 1).zero? && timeout_retry
763
782
  Rails.logger.info("Rest Call - #{ex.class} Timed out will retry after 5 seconds")
764
783
  sleep(self.timeout_sleep)
@@ -858,7 +877,7 @@ module ZuoraAPI
858
877
  self.new_session if z_session
859
878
  return get_file(:url => url, :headers => headers, :count => count - 1, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries, :timeout => timeout)
860
879
 
861
- when Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError
880
+ when *(CONNECTION_EXCEPTIONS).concat(CONNECTION_READ_EXCEPTIONS)
862
881
  Rails.logger.fatal("#{response.class} timeout - retry")
863
882
  return get_file(:url => url, :headers => headers, :count => count, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries - 1, :timeout => timeout)
864
883
 
@@ -931,7 +950,7 @@ module ZuoraAPI
931
950
  size += chunk.size
932
951
  new_progress = (size * 100) / export_size
933
952
  unless new_progress == export_progress
934
- Rails.logger.debug("Login: #{self.username} Export Downloading %s (%3d%%)" % [filename, new_progress])
953
+ Rails.logger.debug("Login: Export Downloading %s (%3d%%)" % [filename, new_progress])
935
954
  end
936
955
  export_progress = new_progress
937
956
  end
@@ -88,7 +88,7 @@ module ZuoraAPI
88
88
  self.current_session = retrieved_session
89
89
  end
90
90
  return self.status
91
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
91
+ rescue *(CONNECTION_EXCEPTIONS).concat(CONNECTION_READ_EXCEPTIONS) => ex
92
92
  if !(tries -= 1).zero?
93
93
  Rails.logger.info {"#{ex.class} Timed out will retry after 5 seconds"}
94
94
  sleep(self.timeout_sleep)
@@ -52,7 +52,7 @@ module ZuoraAPI
52
52
  else
53
53
  return [output_json, response]
54
54
  end
55
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
55
+ rescue *(CONNECTION_EXCEPTIONS).concat(CONNECTION_READ_EXCEPTIONS) => ex
56
56
  if !(tries -= 1).zero?
57
57
  Rails.logger.info {"#{ex.class} Timed out will retry after 5 seconds"}
58
58
  sleep(self.timeout_sleep)
@@ -92,7 +92,7 @@ module ZuoraAPI
92
92
  else
93
93
  return [output_json, response]
94
94
  end
95
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
95
+ rescue *(CONNECTION_EXCEPTIONS).concat(CONNECTION_READ_EXCEPTIONS) => ex
96
96
  if !(tries -= 1).zero?
97
97
  Rails.logger.info {"#{ex.class} Timed out will retry after 5 seconds"}
98
98
  sleep(self.timeout_sleep)
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.6.18"
2
+ VERSION = "1.6.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.18
4
+ version: 1.6.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-26 00:00:00.000000000 Z
11
+ date: 2018-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler