zuora_connect 3.0.0.pre.s → 3.0.0.pre.t
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81197d2fca3e19e8602342a820948d21963735397119b0c992cb316452e25bba
|
4
|
+
data.tar.gz: 43466f6d39c34bb60fa13e63a57c70dc23b9466c0a15a21b9f404a368e4efef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6265d548693f0ff43e39ea5cbec79db9245023f4bc0891ab9c6f7772b795927ef071fd06cadc67043effc0fdab05ecbca7c8dec6064004fa28723617521593f8
|
7
|
+
data.tar.gz: e1ab4768c5037e459b0111ae1a711c04f0163d061c2460e6e5a6c14e383f5f27ed5eb188d6b891ceb6942784d2e73c03f384896a81799d0e1252ebdfb00a34cd
|
@@ -5,6 +5,10 @@ if defined?(Resque::Worker)
|
|
5
5
|
Resque::Job.send(:include, Resque::SelfLookup)
|
6
6
|
end
|
7
7
|
|
8
|
+
if ENV['PROCESS_TYPE'] == 'worker'
|
9
|
+
Rails.logger = ZuoraObservability::Logger.custom_logger(name: 'RailsWorker', level: Logger::INFO)
|
10
|
+
end
|
11
|
+
|
8
12
|
Resque.module_eval do
|
9
13
|
# Returns a hash, mapping queue names to queue sizes
|
10
14
|
def queue_sizes
|
@@ -2,24 +2,25 @@ module Resque
|
|
2
2
|
module Plugins
|
3
3
|
module AppInstanceJob
|
4
4
|
def around_perform(args)
|
5
|
-
case args.class.
|
5
|
+
case args.class.name
|
6
6
|
when "Array"
|
7
|
-
if args.first.
|
7
|
+
if args.first.is_a?(Hash)
|
8
8
|
data = args.first.merge({:worker_class => self.to_s})
|
9
9
|
else
|
10
|
-
data = {:worker_class => self.to_s, :args => args}
|
10
|
+
data = {:worker_class => self.to_s, :args => args.to_json}
|
11
11
|
end
|
12
12
|
when "Hash"
|
13
13
|
data = args.merge({:worker_class => self.to_s})
|
14
14
|
end
|
15
|
+
|
15
16
|
if Rails.logger.is_a?(Ougai::Logger) && !Rails.env.development?
|
16
|
-
Rails.logger.with_fields = {
|
17
|
+
Rails.logger.with_fields = { zecs_service: data.transform_keys(&:to_sym), trace_id: SecureRandom.uuid }
|
17
18
|
end
|
18
19
|
|
19
20
|
begin
|
20
21
|
connection_count ||= 0
|
21
22
|
@appinstance = ZuoraConnect::AppInstance.find(args['app_instance_id'].to_i)
|
22
|
-
job_start_log
|
23
|
+
job_start_log
|
23
24
|
|
24
25
|
@appinstance.new_session(holding_pattern: true)
|
25
26
|
rescue ActiveRecord::RecordNotFound => exception
|
@@ -69,8 +70,8 @@ module Resque
|
|
69
70
|
Rails.logger.flush if Rails.logger.methods.include?(:flush)
|
70
71
|
end
|
71
72
|
|
72
|
-
def job_start_log
|
73
|
-
|
73
|
+
def job_start_log
|
74
|
+
Rails.logger.info('Starting job')
|
74
75
|
end
|
75
76
|
end
|
76
77
|
end
|
@@ -7,25 +7,24 @@ module Resque
|
|
7
7
|
module Plugins
|
8
8
|
module CustomLogger
|
9
9
|
def before_perform(*args)
|
10
|
-
case args.class.
|
10
|
+
case args.class.name
|
11
11
|
when "Array"
|
12
|
-
if args.first.
|
12
|
+
if args.first.is_a?(Hash)
|
13
13
|
data = args.first.merge({:worker_class => self.to_s})
|
14
14
|
else
|
15
|
-
data = {:worker_class => self.to_s, :args => args}
|
15
|
+
data = {:worker_class => self.to_s, :args => args.to_json}
|
16
16
|
end
|
17
17
|
when "Hash"
|
18
18
|
data = args.merge({:worker_class => self.to_s})
|
19
19
|
end
|
20
|
+
|
20
21
|
if Rails.logger.is_a?(Ougai::Logger) && !Rails.env.development?
|
21
|
-
Rails.logger.with_fields = {
|
22
|
-
end
|
23
|
-
data = {:msg => 'Starting job', :job => data}
|
24
|
-
if data.dig(:job, 'app_instance_id').present?
|
25
|
-
data[:app_instance_id] = data.dig(:job, 'app_instance_id')
|
22
|
+
Rails.logger.with_fields = { zecs_service: data.transform_keys(&:to_sym), trace_id: SecureRandom.uuid }
|
26
23
|
end
|
27
24
|
|
28
|
-
|
25
|
+
if data.present?
|
26
|
+
Rails.logger.info('Starting job')
|
27
|
+
end
|
29
28
|
end
|
30
29
|
end
|
31
30
|
end
|