health-monitor-rails 11.3.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/health_monitor/providers/database.rb +1 -1
- data/lib/health_monitor/providers/sidekiq.rb +9 -3
- data/lib/health_monitor/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: 5a4b35be2c84bd3859456f041a978da8828cb72294d86bfab7b97dc3478134b3
|
4
|
+
data.tar.gz: a393dbc7c46777aae939589d443b67ef41abbeb238879adf4ff6985511aceda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f18d57cdf6471cf63e7ad493b4019bf1a5edfca635393aa1f35def68439dfd859b19ccf2fb3f5ab178015db46b24bf7507ed43fbc8efc8114e44d7d7e8ff736
|
7
|
+
data.tar.gz: 4da774036fbbf7e4baf0e6abb2bd7eb313282bc2ea3ca39feded6bfe0c099f2fe5549e02b799e255d9d4738d07bf80ecda5dfd2b10caa213f3f68170204d684d
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ module HealthMonitor
|
|
11
11
|
failed_databases = []
|
12
12
|
|
13
13
|
ActiveRecord::Base.connection_handler.connection_pool_list(:all).each do |cp|
|
14
|
-
cp.connection.
|
14
|
+
cp.connection.execute('SELECT 1')
|
15
15
|
rescue Exception
|
16
16
|
failed_databases << cp.db_config.name
|
17
17
|
end
|
@@ -14,11 +14,14 @@ module HealthMonitor
|
|
14
14
|
DEFAULT_QUEUES_SIZE = 100
|
15
15
|
DEFAULT_RETRY_CHECK = 20
|
16
16
|
|
17
|
+
attr_accessor :maximum_amount_of_retries
|
17
18
|
attr_reader :queues
|
18
19
|
|
19
20
|
def initialize(provider)
|
20
21
|
super(provider)
|
21
22
|
|
23
|
+
@maximum_amount_of_retries = DEFAULT_RETRY_CHECK
|
24
|
+
|
22
25
|
@queues = {}
|
23
26
|
@queues[DEFAULT_QUEUE_NAME] = { latency: DEFAULT_LATENCY_TIMEOUT, queue_size: DEFAULT_QUEUES_SIZE }
|
24
27
|
end
|
@@ -96,10 +99,13 @@ module HealthMonitor
|
|
96
99
|
end
|
97
100
|
|
98
101
|
def check_amount_of_retries!
|
99
|
-
|
100
|
-
|
102
|
+
jobs_over_limit = ::Sidekiq::RetrySet.new.select do |job|
|
103
|
+
job.item['retry_count'] >= configuration.maximum_amount_of_retries
|
104
|
+
end
|
105
|
+
|
106
|
+
return unless jobs_over_limit.any?
|
101
107
|
|
102
|
-
raise "amount of retries for a job is greater than #{maximum_amount_of_retries}"
|
108
|
+
raise "amount of retries for a job is greater than #{configuration.maximum_amount_of_retries}"
|
103
109
|
end
|
104
110
|
|
105
111
|
def check_redis!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health-monitor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonid Beder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|