zuora_connect 3.0.0.pre.c → 3.0.0.pre.h
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 +4 -4
- data/app/models/zuora_connect/app_instance_base.rb +3 -2
- data/lib/middleware/metrics_middleware.rb +4 -1
- data/lib/resque/plugins/app_instance_job.rb +2 -2
- data/lib/resque/plugins/custom_logger.rb +1 -1
- data/lib/zuora_connect/controllers/helpers.rb +3 -3
- data/lib/zuora_connect/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e450ae2dc3cd3261f03188ccabefde7de2d3ae20133afdaf37d6679eb2dea4b
|
4
|
+
data.tar.gz: 7bfb6699dce01ad64f66a5c3e32cbdd86c13f395c9dd4296cbf342d46103b136
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92847fcebbe8021d39052e4d7460e912088af09915fd0829c49ee723e574323b7ab75bbec49c53a306d5daf11d45e68f39cfde3b76facff2088df558c7c2358a
|
7
|
+
data.tar.gz: c2f4ea8ceeb5a5e9f6a793d4e6d7d49adfc9d209ac509b229a44c6afcf5d3e36c9bcb187d0aadd6db0e3fdb62b4d15151113bb68ce853832eb7ce4dda8ecec7a
|
@@ -152,7 +152,8 @@ module ZuoraConnect
|
|
152
152
|
if ZuoraConnect.configuration.mode != "Production"
|
153
153
|
mock_task_data = {
|
154
154
|
"id" => ZuoraConnect.configuration.dev_mode_appinstance,
|
155
|
-
"mode" => ZuoraConnect.configuration.dev_mode_mode
|
155
|
+
"mode" => ZuoraConnect.configuration.dev_mode_mode,
|
156
|
+
"name" => "Developer Instance"
|
156
157
|
}
|
157
158
|
|
158
159
|
case ZuoraConnect.configuration.dev_mode_options.class
|
@@ -168,7 +169,7 @@ module ZuoraConnect
|
|
168
169
|
end
|
169
170
|
|
170
171
|
self.build_task(task_data: mock_task_data, session: session)
|
171
|
-
self.set_backup_creds
|
172
|
+
self.set_backup_creds if !self['zuora_logins'].present?
|
172
173
|
self.last_refresh = Time.now.to_i
|
173
174
|
else
|
174
175
|
time_expire = (session["#{self.id}::last_refresh"] || Time.now).to_i - INSTANCE_REFRESH_WINDOW.ago.to_i
|
@@ -34,8 +34,11 @@ module ZuoraConnect
|
|
34
34
|
@bad_headers.each { |header| env.delete(header) }
|
35
35
|
|
36
36
|
if defined?(Prometheus) && env['PATH_INFO'] == '/connect/internal/metrics'
|
37
|
+
|
37
38
|
# Prometheus Stuff
|
38
|
-
metrics = ZuoraObservability::Metrics.resque
|
39
|
+
metrics = ZuoraObservability::Metrics.resque
|
40
|
+
metrics = defined?(ZuoraConnect::AppInstance.get_metrics) ? ZuoraConnect::AppInstance.get_metrics(metrics) : metrics
|
41
|
+
|
39
42
|
redis_up = metrics.present? && metrics.dig(:Resque, :Workers_Total).present? ? 1 : 0
|
40
43
|
Prometheus::REDIS_CONNECTION.set(redis_up)
|
41
44
|
|
@@ -12,14 +12,14 @@ module Resque
|
|
12
12
|
when "Hash"
|
13
13
|
data = args.merge({:worker_class => self.to_s})
|
14
14
|
end
|
15
|
-
if Rails.logger.is_a?(Ougai::Logger)
|
15
|
+
if Rails.logger.is_a?(Ougai::Logger) && !Rails.env.development?
|
16
16
|
Rails.logger.with_fields = {job: data, trace_id: SecureRandom.uuid, name: "RailsWorker"}
|
17
17
|
end
|
18
18
|
|
19
19
|
begin
|
20
20
|
connection_count ||= 0
|
21
21
|
@appinstance = ZuoraConnect::AppInstance.find(args['app_instance_id'].to_i)
|
22
|
-
Rails.logger.info('Starting job')
|
22
|
+
Rails.logger.info('Starting job', job: data)
|
23
23
|
|
24
24
|
@appinstance.new_session(holding_pattern: true)
|
25
25
|
rescue ActiveRecord::RecordNotFound => exception
|
@@ -17,7 +17,7 @@ module Resque
|
|
17
17
|
when "Hash"
|
18
18
|
data = args.merge({:worker_class => self.to_s})
|
19
19
|
end
|
20
|
-
if Rails.logger.is_a?(Ougai::Logger)
|
20
|
+
if Rails.logger.is_a?(Ougai::Logger) && !Rails.env.development?
|
21
21
|
Rails.logger.with_fields = {job: data, trace_id: SecureRandom.uuid, name: "RailsWorker"}
|
22
22
|
end
|
23
23
|
data = {:msg => 'Starting job', :job => data}
|
@@ -680,7 +680,7 @@ module ZuoraConnect
|
|
680
680
|
session["#{ZuoraConnect.configuration.dev_mode_appinstance}::admin"] = ZuoraConnect.configuration.dev_mode_admin
|
681
681
|
|
682
682
|
values = {
|
683
|
-
id: ZuoraConnect.configuration.dev_mode_appinstance,
|
683
|
+
id: ZuoraConnect.configuration.dev_mode_appinstance,
|
684
684
|
access_token: ZuoraConnect.configuration.dev_mode_user,
|
685
685
|
refresh_token: ZuoraConnect.configuration.dev_mode_pass,
|
686
686
|
token: ZuoraConnect.configuration.dev_mode_pass+ZuoraConnect.configuration.dev_mode_pass,
|
@@ -692,9 +692,9 @@ module ZuoraConnect
|
|
692
692
|
if @appinstance.blank?
|
693
693
|
Apartment::Tenant.switch!("public")
|
694
694
|
begin
|
695
|
-
Apartment::Tenant.create(
|
695
|
+
Apartment::Tenant.create(ZuoraConnect.configuration.dev_mode_appinstance.to_s)
|
696
696
|
rescue Apartment::TenantExists => ex
|
697
|
-
Apartment::Tenant.drop(
|
697
|
+
Apartment::Tenant.drop(ZuoraConnect.configuration.dev_mode_appinstance.to_s)
|
698
698
|
retry
|
699
699
|
end
|
700
700
|
@appinstance = ZuoraConnect::AppInstance.new()
|
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.0.0.pre.
|
4
|
+
version: 3.0.0.pre.h
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apartment
|