zuora_connect 1.7.76 → 1.7.78
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 +17 -9
- data/config/initializers/elastic_apm.rb +21 -0
- data/config/initializers/redis.rb +2 -2
- data/lib/resque/plugins/custom_logger.rb +8 -4
- data/lib/zuora_connect/configuration.rb +2 -2
- data/lib/zuora_connect/engine.rb +1 -6
- data/lib/zuora_connect/version.rb +1 -1
- metadata +33 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2e8c98737cc539599a2c0a01dc77a9b0d302ad3
|
4
|
+
data.tar.gz: 69f90d04820e3f18fdaa267f3bc451fed9a6fc6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1486c95ae9c730c126a1ff00d41ee51710efd84688f1b2032fcf50054cd4f1f80345eeeb0d31c3255376c20684b9afba028735880f5a80a72e842d1595712ae
|
7
|
+
data.tar.gz: b7dc72cf4902faa5c7e0786ce9e1042d279cd6aaa012f80e19905c87e8ce445d34862fd028b8ccc10f1f44284075c24e35c635511d9d0a9b2e724354db5789f2
|
@@ -63,17 +63,25 @@ module ZuoraConnect
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def apartment_switch(method = nil, migrate = false)
|
66
|
-
|
67
|
-
|
68
|
-
rescue Apartment::TenantNotFound => ex
|
66
|
+
switch_count ||= 0
|
67
|
+
if self.persisted?
|
69
68
|
begin
|
70
|
-
Apartment::Tenant.
|
71
|
-
rescue Apartment::
|
69
|
+
Apartment::Tenant.switch!(self.id)
|
70
|
+
rescue Apartment::TenantNotFound => ex
|
71
|
+
sleep(2)
|
72
|
+
begin
|
73
|
+
Apartment::Tenant.create(self.id.to_s)
|
74
|
+
rescue Apartment::TenantExists => ex
|
75
|
+
end
|
76
|
+
if (switch_count += 1) < 2
|
77
|
+
retry
|
78
|
+
else
|
79
|
+
raise
|
80
|
+
end
|
81
|
+
end
|
82
|
+
if migrate && ActiveRecord::Migrator.needs_migration?
|
83
|
+
Apartment::Migrator.migrate(self.id)
|
72
84
|
end
|
73
|
-
retry
|
74
|
-
end
|
75
|
-
if migrate && ActiveRecord::Migrator.needs_migration?
|
76
|
-
Apartment::Migrator.migrate(self.id)
|
77
85
|
end
|
78
86
|
Thread.current[:appinstance] = self
|
79
87
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
ElasticAPM.agent.config.disable_send = true
|
2
|
+
if ZuoraConnect.configuration.enable_apm && !defined?(Rails::Console)
|
3
|
+
case Rails.env.to_s
|
4
|
+
when 'production'
|
5
|
+
ElasticAPM.agent.config.server_url = "http://apm-server.logging:8200"
|
6
|
+
ElasticAPM.agent.config.transaction_sample_rate = 0.20
|
7
|
+
ElasticAPM.agent.config.capture_body = false
|
8
|
+
when 'staging'
|
9
|
+
ElasticAPM.agent.config.server_url = "http://apm-server.logging:8200"
|
10
|
+
ElasticAPM.agent.config.transaction_sample_rate = 1.0
|
11
|
+
when 'development'
|
12
|
+
ElasticAPM.agent.config.server_url = "http://logging.0.ecc.auw2.zuora:8200"
|
13
|
+
ElasticAPM.agent.config.transaction_sample_rate = 1.0
|
14
|
+
end
|
15
|
+
ElasticAPM.agent.config.pool_size = 1
|
16
|
+
ElasticAPM.agent.config.transaction_max_spans = 500
|
17
|
+
ElasticAPM.agent.config.ignore_url_patterns = ['^\/admin\/resque.*', '^\/admin\/redis.*', '^\/admin\/peek.*', '^\/peek.*']
|
18
|
+
ElasticAPM.agent.config.verify_server_cert = false
|
19
|
+
ElasticAPM.agent.config.log_level = Logger::INFO
|
20
|
+
ElasticAPM.agent.config.disable_send = false
|
21
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
redis_url = ENV["REDIS_URL"].present? ? ENV["REDIS_URL"] : defined?(Rails.application.secrets.redis) ? Rails.application.secrets.redis : 'redis://localhost:6379/1'
|
2
2
|
resque_url = ENV["RESQUE_URL"].present? ? ENV["RESQUE_URL"] : defined?(Rails.application.secrets.resque) ? Rails.application.secrets.resque : 'redis://localhost:6379/1'
|
3
3
|
if defined?(Redis.current)
|
4
|
-
Redis.current = Redis.new(:id => "#{ZuoraConnect::Telegraf.full_process_name(process_name: 'Redis')}", :url => redis_url, :timeout =>
|
4
|
+
Redis.current = Redis.new(:id => "#{ZuoraConnect::Telegraf.full_process_name(process_name: 'Redis')}", :url => redis_url, :timeout => 6, :reconnect_attempts => 2)
|
5
5
|
if defined?(Resque.redis)
|
6
|
-
Resque.redis = resque_url != redis_url ? Redis.new(:id => "#{ZuoraConnect::Telegraf.full_process_name(process_name: 'Resque')}", :url => resque_url, :timeout =>
|
6
|
+
Resque.redis = resque_url != redis_url ? Redis.new(:id => "#{ZuoraConnect::Telegraf.full_process_name(process_name: 'Resque')}", :url => resque_url, :timeout => 6, :reconnect_attempts => 2) : Redis.current
|
7
7
|
end
|
8
8
|
end
|
9
9
|
if defined?(RedisBrowser)
|
@@ -29,10 +29,14 @@ module Resque
|
|
29
29
|
|
30
30
|
Resque.logger = logger
|
31
31
|
Rails.logger = logger
|
32
|
-
case args.class
|
33
|
-
when Array
|
34
|
-
|
35
|
-
|
32
|
+
case args.class.to_s
|
33
|
+
when "Array"
|
34
|
+
if args.first.class == Hash
|
35
|
+
data = args.first.merge({:worker_class => self.to_s})
|
36
|
+
else
|
37
|
+
data = {:worker_class => self.to_s, :args => args}
|
38
|
+
end
|
39
|
+
when "Hash"
|
36
40
|
data = args.merge({:worker_class => self.to_s})
|
37
41
|
end
|
38
42
|
Rails.logger.info(data.to_json) if data.present?
|
@@ -3,7 +3,7 @@ module ZuoraConnect
|
|
3
3
|
|
4
4
|
attr_accessor :default_locale, :default_time_zone, :url, :mode, :delayed_job,:private_key, :additional_apartment_models
|
5
5
|
|
6
|
-
attr_accessor :enable_metrics, :telegraf_endpoint, :telegraf_debug, :custom_prometheus_update_block, :silencer_resque_finish, :blpop_queue
|
6
|
+
attr_accessor :enable_metrics, :enable_apm, :telegraf_endpoint, :telegraf_debug, :custom_prometheus_update_block, :silencer_resque_finish, :blpop_queue
|
7
7
|
|
8
8
|
attr_accessor :oauth_client_id, :oauth_client_secret, :oauth_client_redirect_uri
|
9
9
|
|
@@ -24,7 +24,7 @@ module ZuoraConnect
|
|
24
24
|
@enable_metrics = false
|
25
25
|
@telegraf_endpoint = 'udp://telegraf-app-metrics.monitoring.svc.cluster.local:8094'
|
26
26
|
@telegraf_debug = false
|
27
|
-
|
27
|
+
@enable_apm = false
|
28
28
|
# OAuth Settings
|
29
29
|
@oauth_client_id = ""
|
30
30
|
@oauth_client_secret = ""
|
data/lib/zuora_connect/engine.rb
CHANGED
@@ -15,7 +15,7 @@ module ZuoraConnect
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
initializer :append_migrations do |app|
|
19
19
|
unless app.root.to_s.match root.to_s
|
20
20
|
config.paths["db/migrate"].expanded.each do |expanded_path|
|
21
21
|
app.config.paths["db/migrate"] << expanded_path
|
@@ -28,10 +28,5 @@ module ZuoraConnect
|
|
28
28
|
include ZuoraConnect::Controllers::Helpers
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
32
|
-
# initializer :append_migrations do |app|
|
33
|
-
# next if app.root.to_s.start_with?(root.to_s) # only run when called from other apps
|
34
|
-
# app.config.paths['db/migrate'].concat(config.paths['db/migrate'].expanded)
|
35
|
-
# end
|
36
31
|
end
|
37
32
|
end
|
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.78
|
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-03-
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apartment
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.2'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.2'
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
26
|
+
version: '0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: zuora_api
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,14 +50,40 @@ dependencies:
|
|
56
50
|
requirements:
|
57
51
|
- - "~>"
|
58
52
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
53
|
+
version: 0.16.4
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.16.4
|
60
57
|
type: :runtime
|
61
58
|
prerelease: false
|
62
59
|
version_requirements: !ruby/object:Gem::Requirement
|
63
60
|
requirements:
|
64
61
|
- - "~>"
|
65
62
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.
|
63
|
+
version: 0.16.4
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.16.4
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: elastic-apm
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 2.5.0
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 2.5.0
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 2.5.0
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 2.5.0
|
67
87
|
- !ruby/object:Gem::Dependency
|
68
88
|
name: bundler
|
69
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -285,6 +305,7 @@ files:
|
|
285
305
|
- app/views/zuora_connect/static/session_error.html.erb
|
286
306
|
- config/initializers/apartment.rb
|
287
307
|
- config/initializers/aws.rb
|
308
|
+
- config/initializers/elastic_apm.rb
|
288
309
|
- config/initializers/object_method_hooks.rb
|
289
310
|
- config/initializers/postgresql_adapter.rb
|
290
311
|
- config/initializers/prometheus.rb
|