zuora_connect 2.0.5v → 2.0.5w

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
  SHA256:
3
- metadata.gz: f1f2b88fd1b3305c5c677d14f745aea85335bee8cedac9200de6f827958c69d8
4
- data.tar.gz: 4fcd495431d0068a304f725607e0269c3a6eaab05eb0d2e0f59ec8630deaad6d
3
+ metadata.gz: eb3e213c5a0224ae13ca2b9cc309bd1fc90e898275e2910ffcdb56f9c3d273a7
4
+ data.tar.gz: a1dc3a39d74e809c6bec463c4e31f11b326af8d19d369829aa8f703bf65e9edf
5
5
  SHA512:
6
- metadata.gz: 0b5d44b0ce40d3a170245a72f21b7a986913d2ccdc8f2c65c43cd9ab60ff1cd869d31b7ea591c45257858f3aeab51509f7a9c4bb4074566835799489ba85915d
7
- data.tar.gz: 301b473fe5774e8dfb3526daa2a7fb854f68253c7c438a4e5398249822395db2cd37708f5b65015366c1f2b78232abdde7c03d2e1efff2920d59b9750e298a10
6
+ metadata.gz: 6d393169d0bbb1c9bbbae8b4c17d784292d65db56f25067540d0883382e4ba79c8880c511084e9399f0970aac14cd54d4aa388334466e07da700e06893233d5b
7
+ data.tar.gz: 9e4a4d2cc55a4d38bdc7f35074be3abc02364948b0704554a8e6637812939f8671864fe35cc08d6ac7727a7ea837f36af3aacfeb003424c5aa6843c4f88cae44
@@ -34,6 +34,7 @@ module ZuoraConnect
34
34
  def initialize_app
35
35
  begin
36
36
  authenticate_connect_app_request
37
+ @appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
37
38
  render json: {
38
39
  message: "Success",
39
40
  status: 200
@@ -16,7 +16,7 @@ module ZuoraConnect
16
16
  BLANK_OBJECT_ID_LOOKUP = 'BlankValueSupplied'
17
17
  HOLDING_PATTERN_SLEEP = 5.seconds
18
18
  CONNECT_COMMUNICATION_SLEEP= 5.seconds
19
- IGNORED_LOCALS = ['fr', 'ja', 'es', 'zh']
19
+ IGNORED_LOCALS = ['fr', 'ja', 'es', 'zh', 'de']
20
20
  INTERNAL_HOSTS = []
21
21
  LOGIN_TENANT_DESTINATION = 'target_login'
22
22
 
@@ -229,6 +229,7 @@ module ZuoraConnect
229
229
  end
230
230
  rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
231
231
  if (refresh_count += 1) < 3
232
+ sleep(30)
232
233
  ZuoraConnect.logger.info("[#{self.id}] REFRESH TASK - #{ex.class} Retrying(#{refresh_count})")
233
234
  retry
234
235
  else
@@ -180,7 +180,7 @@ module ZuoraConnect
180
180
  }
181
181
  return
182
182
  end
183
-
183
+ Apartment::Tenant.switch!("public")
184
184
  ActiveRecord::Base.transaction do
185
185
  ActiveRecord::Base.connection.execute('LOCK public.zuora_users IN ACCESS EXCLUSIVE MODE')
186
186
  appinstances = ZuoraConnect::AppInstance.where("zuora_entity_ids ?& array[:entities] = true AND zuora_domain = :host", entities: [zuora_entity_id], host: zuora_client.rest_domain).pluck(:id, :name)
@@ -286,7 +286,7 @@ module ZuoraConnect
286
286
  setup_instance_via_dev_mode
287
287
  end
288
288
 
289
- if !defined?(@appinstance)
289
+ if !defined?(@appinstance) || @appinstance.blank?
290
290
  render "zuora_connect/static/error_handled", :locals => {
291
291
  :title => "Application state could not be found.",
292
292
  :message => "Please relaunch application."
@@ -31,13 +31,33 @@ module ZuoraConnect
31
31
  ActiveSupport::Notifications.subscribe('process_action.action_controller', ZuoraConnect::PageRequest.new)
32
32
 
33
33
  initializer(:rails_stdout_logging, before: :initialize_logger) do
34
- if Rails.env != 'development' && !ENV['DEIS_APP'].blank?
35
- require 'lograge'
36
-
37
- Rails.configuration.logger = ZuoraConnect.custom_logger(name: "Rails")
34
+ require 'lograge'
35
+ Rails.configuration.logger = ZuoraConnect.custom_logger(name: "Rails")
38
36
 
37
+ if Rails.env != 'development'
39
38
  Rails.configuration.lograge.enabled = true
40
39
  Rails.configuration.colorize_logging = false
40
+ else
41
+ Rails.configuration.logger.before_log = lambda do |data|
42
+ end
43
+ Rails.configuration.logger.formatter = Ougai::Formatters::Customizable.new(
44
+ format_err: proc do |data|
45
+ next nil unless data.key?(:err)
46
+ err = data.delete(:err)
47
+ " #{err[:name]} (#{err[:message]})\n #{err[:stack]}"
48
+ end,
49
+ format_data: proc do |data|
50
+ format('%s %s: %s', 'DATA'.ljust(6), Time.now.strftime('%FT%T.%6NZ'), "#{data.to_json}") if data.present?
51
+ end,
52
+ format_msg: proc do |severity, datetime, _progname, data|
53
+ msg = data.delete(:msg)
54
+ format('%s %s: %s', severity.ljust(6), datetime, msg)
55
+ end
56
+ )
57
+ Rails.configuration.logger.formatter.datetime_format = '%FT%T.%6NZ'
58
+ end
59
+
60
+ if Rails.configuration.lograge.enabled
41
61
  if Rails.configuration.logger.class.to_s == 'Ougai::Logger'
42
62
  Rails.configuration.lograge.formatter = Class.new do |fmt|
43
63
  def fmt.call(data)
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.5v"
2
+ VERSION = "2.0.5w"
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: 2.0.5v
4
+ version: 2.0.5w
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-07-05 00:00:00.000000000 Z
11
+ date: 2019-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ougai-formatters-customizable
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: zuora_api
43
57
  requirement: !ruby/object:Gem::Requirement