zuora_connect 1.7.44 → 1.7.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccccf542a4592e25ef4c2e1eb29bec32825aaf8a
4
- data.tar.gz: 1249b913e677faa0cdd25992553fdd6c8bd39098
3
+ metadata.gz: 220690aeadd38cef3be8b43208affa8834c7db1e
4
+ data.tar.gz: 4c475d5be8d63d5d98132656e874004816cfa877
5
5
  SHA512:
6
- metadata.gz: a428df87ed15ecbf85737df64bc2c2f0837182b78fadcd65bf2e7fd136582223fb54b0f1f049f86097032316297cae3b68219e6da746f2185a4a1465a7376bc1
7
- data.tar.gz: 09e4198114efbd96daf3b4d21a1eec5623172a2a4186af8bea4948d8519145c1de552437c7ff6dca09c6a4972ed4c7c1135f1106e09c72be751061eb8f923bbb
6
+ metadata.gz: 8c1eea6bffd8b23012dfcd4c215b37d871d0d3c3fc2d82b5626aae5f8a5016b23acf0e2fa76c8cd47030a9d709bd865650db0558e2fd1d688ba349dd95bf0fcd
7
+ data.tar.gz: b35d70279fe75181a5c6e155d7dc75bb5bb6ca5edba53ae009558ced45d63db25656dbcc53dc87e5bd3ea0540a14cdf5d86a8206bd3252ec375c18b06632313d
@@ -11,6 +11,8 @@ module ZuoraConnect
11
11
  INSTANCE_REDIS_CACHE_PERIOD = 24.hours #Used to determine how long to cached task data will live for
12
12
  API_LIMIT_TIMEOUT = 2.minutes #Used to set the default for expiring timeout when api rate limiting is in effect
13
13
  BLANK_OBJECT_ID_LOOKUP = 'BlankValueSupplied'
14
+ HOLDING_PATTERN_SLEEP = 5.seconds
15
+ CONNECT_COMMUNICATION_SLEEP= 5.seconds
14
16
 
15
17
  def init
16
18
  self.connect_user = 'Nobody'
@@ -122,7 +124,7 @@ module ZuoraConnect
122
124
  rescue ZuoraConnect::Exceptions::HoldingPattern => ex
123
125
  while self.marked_for_refresh?
124
126
  Rails.logger.info("Holding - Expires in #{self.reset_mark_expires_at}. '#{self.new_session_message}'")
125
- sleep(5)
127
+ sleep(HOLDING_PATTERN_SLEEP)
126
128
  end
127
129
  self.reload_attributes([:refresh_token, :oauth_expires_at, :access_token])
128
130
  session = self.data_lookup(session: session)
@@ -161,7 +163,7 @@ module ZuoraConnect
161
163
  Rails.logger.fatal("[#{self.id}] REFRESH TASK - Failed Code #{response.code}")
162
164
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
163
165
  end
164
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
166
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
165
167
  if (refresh_count += 1) < 3
166
168
  Rails.logger.info("[#{self.id}] REFRESH TASK - #{ex.class} Retrying(#{refresh_count})")
167
169
  retry
@@ -285,7 +287,7 @@ module ZuoraConnect
285
287
  else
286
288
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
287
289
  end
288
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
290
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
289
291
  if (update_login_count += 1) < 3
290
292
  retry
291
293
  else
@@ -313,7 +315,7 @@ module ZuoraConnect
313
315
  else
314
316
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
315
317
  end
316
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
318
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
317
319
  if (update_task_count += 1) < 3
318
320
  retry
319
321
  else
@@ -367,7 +369,7 @@ module ZuoraConnect
367
369
  Rails.logger.fatal("[#{self.id}] REFRESH OAUTH - Failed Code #{response.code}")
368
370
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Refreshing Access Token", response.body, response.code)
369
371
  end
370
- rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
372
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
371
373
  if (refresh_oauth_count += 1) < 3
372
374
  Rails.logger.info("[#{self.id}] REFRESH OAUTH - #{ex.class} Retrying(#{refresh_oauth_count})")
373
375
  retry
@@ -376,7 +378,7 @@ module ZuoraConnect
376
378
  raise
377
379
  end
378
380
  rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
379
- sleep(5)
381
+ sleep(CONNECT_COMMUNICATION_SLEEP)
380
382
  self.reload_attributes([:refresh_token, :oauth_expires_at, :access_token]) #Reload only the refresh token for retry
381
383
 
382
384
  #After reload, if nolonger expired return
@@ -415,7 +417,16 @@ module ZuoraConnect
415
417
 
416
418
  def data_lookup(session: {})
417
419
  if defined?(Redis.current)
418
- cached_instance = Redis.current.get("AppInstance:#{self.id}")
420
+ begin
421
+ redis_get_command ||= 0
422
+ cached_instance = Redis.current.get("AppInstance:#{self.id}")
423
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
424
+ if (redis_get_command += 1) < 3
425
+ retry
426
+ else
427
+ raise
428
+ end
429
+ end
419
430
  if cached_instance.blank?
420
431
  Rails.logger.debug("[#{self.id}] Cached AppInstance Missing")
421
432
  return session
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.7.44"
2
+ VERSION = "1.7.45"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.44
4
+ version: 1.7.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -36,20 +36,20 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 1.6.0
39
+ version: 1.6.21
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.6.0
42
+ version: 1.6.21
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.6.0
49
+ version: 1.6.21
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.6.0
52
+ version: 1.6.21
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: httparty
55
55
  requirement: !ruby/object:Gem::Requirement