zuora_connect 3.1.1.pre.c → 3.1.1

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: ef73a28bd87609cedef16023f75320765d7b38b3e3417be5b5000be410596127
4
- data.tar.gz: 62440f4e6e5ae219f40d9dc5b927b896cd26214cb9693191629929594c9f349a
3
+ metadata.gz: 5eedfed1cc9d304e303303bbda985be007df987f6c50c8cebf4bef6ee2f630a2
4
+ data.tar.gz: 77bbf5a323c63814cb50521ffd244c601b40e3f5c07bc8208f9996b83fe5090e
5
5
  SHA512:
6
- metadata.gz: fe0dc6bf317c0ff0e76d069db2abd158175527cd5b971065b6c84d79412971c4fbab8ad5141bd4525497d41e38ca2b99c0760f662791a920955770692e278ef5
7
- data.tar.gz: f15d374ed1aaa037ca1764d71f468eac6019b6515ac0a41f20835e732adc0dc9651b893f8f5f18b2a494e2e54f083be7dda77b9a6863dbd53a1d39f13e7cb221
6
+ metadata.gz: 519cf6f3002ff33a5849e297e74ccd7a541a9677fdbf28e7481848d3ef74f2521555c129fa215db87dc5565fa7c0afa4ea3ce19c6555ad0bec8878fe41d48d78
7
+ data.tar.gz: 6db95ad4869e55739c648492a830054c8f59b574a6ddabf80b8de24ff1e67356e7df492fcf742a6afea5bb65f34f215252dd2466d5c264578c5c0cd224866fe4
@@ -353,10 +353,8 @@ module ZuoraConnect
353
353
  end
354
354
 
355
355
  def fetch_connect_data(session: {})
356
- refresh_count ||= 0
357
356
  self.check_oauth_state
358
- request_url = ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}.json"
359
- response = HTTParty.get(request_url,:body => {:access_token => self.access_token})
357
+ response = HTTParty.get(ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}.json",:body => {:access_token => self.access_token})
360
358
 
361
359
  if response.code == 200
362
360
  begin
@@ -369,43 +367,45 @@ module ZuoraConnect
369
367
  self.set_backup_creds
370
368
  self.save(validate: false) if self.changed?
371
369
  else
372
- raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error communicating with Connect for '#{request_url}' with #{response.code}", response.body, response.code)
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
370
+ raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
393
371
  end
394
372
  end
395
373
 
374
+
396
375
  def refresh(session: {})
397
376
  refresh_count ||= 0
398
377
  skip_connect ||= ZuoraConnect.configuration.skip_connect
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)
378
+ begin
379
+ #Check how app was deployed
380
+ if !self.auto_deployed? && (!skip_connect || self['zuora_logins'].blank?)
381
+ self.fetch_connect_data(session: session)
382
+ else
383
+ self.build_task(task_data: self.zuora_logins, session: session)
384
+ end
385
+ self.last_refresh = Time.now.to_i
386
+ self.cache_app_instance
387
+ self.reset_mark_for_refresh
388
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
389
+ refresh_count += 1
390
+ if refresh_count < 3
391
+ sleep(10)
392
+ ZuoraConnect.logger.debug("REFRESH TASK - Connection Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
393
+ retry
394
+ else
395
+ ZuoraConnect.logger.fatal("REFRESH TASK - Connection Failed", ex)
396
+ raise
397
+ end
398
+ rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
399
+ refresh_count += 1
400
+ if refresh_count < 3
401
+ ZuoraConnect.logger.debug("REFRESH TASK - Communication Failure Retrying(#{refresh_count})", ex, self.default_ougai_items)
402
+ self.refresh_oauth if ex.code == 401
403
+ retry
404
+ else
405
+ ZuoraConnect.logger.fatal("REFRESH TASK - Communication Failed #{ex.code}", ex, self.default_ougai_items)
406
+ raise
407
+ end
404
408
  end
405
- self.last_refresh = Time.now.to_i
406
- self.cache_app_instance
407
- self.reset_mark_for_refresh
408
-
409
409
  rescue => ex
410
410
  refresh_count += 1
411
411
  if self['zuora_logins'].present? && refresh_count < 3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZuoraConnect
4
- VERSION = "3.1.1-c"
4
+ VERSION = "3.1.1"
5
5
  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: 3.1.1.pre.c
4
+ version: 3.1.1
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-13 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -452,9 +452,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
452
452
  version: '0'
453
453
  required_rubygems_version: !ruby/object:Gem::Requirement
454
454
  requirements:
455
- - - ">"
455
+ - - ">="
456
456
  - !ruby/object:Gem::Version
457
- version: 1.3.1
457
+ version: '0'
458
458
  requirements: []
459
459
  rubygems_version: 3.3.7
460
460
  signing_key: