zuora_connect 3.1.1.pre.b → 3.1.1.pre.c
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef73a28bd87609cedef16023f75320765d7b38b3e3417be5b5000be410596127
|
4
|
+
data.tar.gz: 62440f4e6e5ae219f40d9dc5b927b896cd26214cb9693191629929594c9f349a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe0dc6bf317c0ff0e76d069db2abd158175527cd5b971065b6c84d79412971c4fbab8ad5141bd4525497d41e38ca2b99c0760f662791a920955770692e278ef5
|
7
|
+
data.tar.gz: f15d374ed1aaa037ca1764d71f468eac6019b6515ac0a41f20835e732adc0dc9651b893f8f5f18b2a494e2e54f083be7dda77b9a6863dbd53a1d39f13e7cb221
|
@@ -43,7 +43,6 @@ module ZuoraConnect
|
|
43
43
|
|
44
44
|
def cache_bust
|
45
45
|
if defined?(Redis.current)
|
46
|
-
@appinstance.reload
|
47
46
|
@appinstance.fetch_connect_data #Fetch data and set in database if kms key is used
|
48
47
|
@appinstance.cache_app_instance(force_cache: true) #Update cache in redis
|
49
48
|
Redis.current.del("AppInstance:#{@appinstance.id}")
|
@@ -353,6 +353,7 @@ module ZuoraConnect
|
|
353
353
|
end
|
354
354
|
|
355
355
|
def fetch_connect_data(session: {})
|
356
|
+
refresh_count ||= 0
|
356
357
|
self.check_oauth_state
|
357
358
|
request_url = ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}.json"
|
358
359
|
response = HTTParty.get(request_url,:body => {:access_token => self.access_token})
|
@@ -370,43 +371,41 @@ module ZuoraConnect
|
|
370
371
|
else
|
371
372
|
raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error communicating with Connect for '#{request_url}' with #{response.code}", response.body, response.code)
|
372
373
|
end
|
374
|
+
rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
|
375
|
+
refresh_count += 1
|
376
|
+
if refresh_count < 3
|
377
|
+
sleep(10)
|
378
|
+
ZuoraConnect.logger.debug("REFRESH TASK - Connection Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
|
379
|
+
retry
|
380
|
+
else
|
381
|
+
ZuoraConnect.logger.fatal("REFRESH TASK - Connection Failed", ex)
|
382
|
+
raise
|
383
|
+
end
|
384
|
+
rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
|
385
|
+
refresh_count += 1
|
386
|
+
if refresh_count < 3
|
387
|
+
ZuoraConnect.logger.debug("REFRESH TASK - Communication Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
|
388
|
+
self.refresh_oauth if ex.code == 401
|
389
|
+
retry
|
390
|
+
else
|
391
|
+
ZuoraConnect.logger.fatal("REFRESH TASK - Communication Failed #{ex.code}", ex, self.default_ougai_items)
|
392
|
+
raise
|
393
|
+
end
|
373
394
|
end
|
374
395
|
|
375
|
-
|
376
396
|
def refresh(session: {})
|
377
397
|
refresh_count ||= 0
|
378
398
|
skip_connect ||= ZuoraConnect.configuration.skip_connect
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
self.build_task(task_data: self.zuora_logins, session: session)
|
385
|
-
end
|
386
|
-
self.last_refresh = Time.now.to_i
|
387
|
-
self.cache_app_instance
|
388
|
-
self.reset_mark_for_refresh
|
389
|
-
rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
|
390
|
-
refresh_count += 1
|
391
|
-
if refresh_count < 3
|
392
|
-
sleep(10)
|
393
|
-
ZuoraConnect.logger.debug("REFRESH TASK - Connection Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
|
394
|
-
retry
|
395
|
-
else
|
396
|
-
ZuoraConnect.logger.fatal("REFRESH TASK - Connection Failed", ex)
|
397
|
-
raise
|
398
|
-
end
|
399
|
-
rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
|
400
|
-
refresh_count += 1
|
401
|
-
if refresh_count < 3
|
402
|
-
ZuoraConnect.logger.debug("REFRESH TASK - Communication Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
|
403
|
-
self.refresh_oauth if ex.code == 401
|
404
|
-
retry
|
405
|
-
else
|
406
|
-
ZuoraConnect.logger.fatal("REFRESH TASK - Communication Failed #{ex.code}", ex, self.default_ougai_items)
|
407
|
-
raise
|
408
|
-
end
|
399
|
+
#Check how app was deployed
|
400
|
+
if !self.auto_deployed? && (!skip_connect || self['zuora_logins'].blank?)
|
401
|
+
self.fetch_connect_data(session: session)
|
402
|
+
else
|
403
|
+
self.build_task(task_data: self.zuora_logins, session: session)
|
409
404
|
end
|
405
|
+
self.last_refresh = Time.now.to_i
|
406
|
+
self.cache_app_instance
|
407
|
+
self.reset_mark_for_refresh
|
408
|
+
|
410
409
|
rescue => ex
|
411
410
|
refresh_count += 1
|
412
411
|
if self['zuora_logins'].present? && refresh_count < 3
|
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: 3.1.1.pre.
|
4
|
+
version: 3.1.1.pre.c
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apartment
|