zuora_api 1.3.9996 → 1.3.9998
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zuora_api/login.rb +19 -2
- data/lib/zuora_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 019fd712c31f3502a467072c8ce59395c14f2a75
|
4
|
+
data.tar.gz: b8c4c4504817d387c11e69572e70d51a57bd7d64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23dfa1fa1f99e16ad3a53529964d068aebd9e69a2d6d7477b1ffdba0adcaad4f30054eee8202726fa731d52ae186f1caaad3fd21df54b1ae5a31796b3992a9cd
|
7
|
+
data.tar.gz: 5b9271a4debd7602c01ebba79a96177267743eb4e7fe11c4a045e6b6536a0b236ff9b48e862297a58e1935d2b9264f3995bfcf7e37c8ea85c4e5402c1c88e097
|
data/lib/zuora_api/login.rb
CHANGED
@@ -5,7 +5,7 @@ module ZuoraAPI
|
|
5
5
|
class Login
|
6
6
|
ENVIRONMENTS = [SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown' ]
|
7
7
|
REGIONS = [EU = 'EU', US = 'US' ]
|
8
|
-
attr_accessor :username, :password, :region,:url, :wsdl_number, :current_session, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name, :entity_id
|
8
|
+
attr_accessor :username, :password, :region,:url, :wsdl_number, :current_session, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name, :entity_id, :timeout_sleep
|
9
9
|
|
10
10
|
def initialize(username: nil, password: nil, url: nil, entity_id: nil, session: nil, **keyword_args)
|
11
11
|
@username = username
|
@@ -17,6 +17,7 @@ module ZuoraAPI
|
|
17
17
|
@status = "Active"
|
18
18
|
@user_info = Hash.new
|
19
19
|
self.update_environment
|
20
|
+
@timeout_sleep = 5
|
20
21
|
end
|
21
22
|
|
22
23
|
|
@@ -182,7 +183,7 @@ module ZuoraAPI
|
|
182
183
|
rescue Net::ReadTimeout, Net::OpenTimeout => ex
|
183
184
|
if !(tries -= 1).zero?
|
184
185
|
Rails.logger.debug {"#{ex.class} Timed out will retry after 5 seconds"}
|
185
|
-
sleep(
|
186
|
+
sleep(self.timeout_sleep)
|
186
187
|
retry
|
187
188
|
else
|
188
189
|
self.current_error = "Request timed out. Try again"
|
@@ -256,6 +257,8 @@ module ZuoraAPI
|
|
256
257
|
end
|
257
258
|
rescue Net::ReadTimeout, Net::OpenTimeout => ex
|
258
259
|
if !(tries -= 1).zero? && timeout_retry
|
260
|
+
Rails.logger.debug {"#{ex.class} Timed out will retry after 5 seconds"}
|
261
|
+
sleep(self.timeout_sleep)
|
259
262
|
retry
|
260
263
|
else
|
261
264
|
raise ex
|
@@ -374,6 +377,7 @@ module ZuoraAPI
|
|
374
377
|
end
|
375
378
|
|
376
379
|
def describe_call(object = nil)
|
380
|
+
tries ||= 2
|
377
381
|
self.get_session
|
378
382
|
base = self.url.include?(".com") ? self.url.split(".com")[0].concat(".com") : self.url.split(".eu")[0].concat(".eu")
|
379
383
|
url = object ? "#{base}/apps/api/describe/#{object}" : "#{base}/apps/api/describe/"
|
@@ -408,6 +412,17 @@ module ZuoraAPI
|
|
408
412
|
end
|
409
413
|
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
|
410
414
|
end
|
415
|
+
rescue Net::ReadTimeout, Net::OpenTimeout => ex
|
416
|
+
if !(tries -= 1).zero?
|
417
|
+
Rails.logger.debug {"#{ex.class} Timed out will retry after 5 seconds"}
|
418
|
+
sleep(self.timeout_sleep)
|
419
|
+
retry
|
420
|
+
else
|
421
|
+
raise ex
|
422
|
+
end
|
423
|
+
rescue => ex
|
424
|
+
raise ex
|
425
|
+
else
|
411
426
|
return des_hash
|
412
427
|
end
|
413
428
|
|
@@ -447,6 +462,8 @@ module ZuoraAPI
|
|
447
462
|
end
|
448
463
|
rescue Net::ReadTimeout, Net::OpenTimeout => ex
|
449
464
|
if !(tries -= 1).zero? && timeout_retry
|
465
|
+
Rails.logger.debug {"#{ex.class} Timed out will retry after 5 seconds"}
|
466
|
+
sleep(self.timeout_sleep)
|
450
467
|
retry
|
451
468
|
else
|
452
469
|
raise ex
|
data/lib/zuora_api/version.rb
CHANGED
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.3.
|
4
|
+
version: 1.3.9998
|
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: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|