health-monitor-rails 10.0.0 → 10.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62c9d1e35830ba8c1c158c69b42a8ca5e88e5a127e9f55e7641f19105fdc1386
|
4
|
+
data.tar.gz: 1c82d4f832b886f8f85d6e1197fdd35d1839c10073848832d3a2c604b44e008a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5249cc195b5e672c000989641fb3b4456edc14025fab3f817668d74767859fab36bb94fe87fe0f86443de64c4baa2dacca6c2f24fc3655637ccc850fa3262b
|
7
|
+
data.tar.gz: 60a8ddc89ba7d9b4f0b0223f92d2138a9f28921e3f60857831594bc66cb7093a0f07335fd974a829492ff3996ec9460c3a954ac4cf8505f86ee542ce6cc554f9
|
@@ -16,8 +16,8 @@ module HealthMonitor
|
|
16
16
|
|
17
17
|
respond_to do |format|
|
18
18
|
format.html
|
19
|
-
format.json { render json: statuses.to_json, status: statuses[:status] }
|
20
|
-
format.xml { render xml: statuses.to_xml, status: statuses[:status] }
|
19
|
+
format.json { render json: @statuses.to_json, status: @statuses[:status] }
|
20
|
+
format.xml { render xml: @statuses.to_xml, status: @statuses[:status] }
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -12,6 +12,7 @@ module HealthMonitor
|
|
12
12
|
DEFAULT_QUEUE_NAME = 'default'
|
13
13
|
DEFAULT_LATENCY_TIMEOUT = 30
|
14
14
|
DEFAULT_QUEUES_SIZE = 100
|
15
|
+
DEFAULT_RETRY_CHECK = 20
|
15
16
|
|
16
17
|
attr_reader :queues
|
17
18
|
|
@@ -53,6 +54,7 @@ module HealthMonitor
|
|
53
54
|
check_latency!
|
54
55
|
check_queue_size!
|
55
56
|
check_redis!
|
57
|
+
check_amount_of_retries!
|
56
58
|
rescue Exception => e
|
57
59
|
raise SidekiqException.new(e)
|
58
60
|
end
|
@@ -95,6 +97,13 @@ module HealthMonitor
|
|
95
97
|
end
|
96
98
|
end
|
97
99
|
|
100
|
+
def check_amount_of_retries!
|
101
|
+
maximum_amount_of_retries = ::HealthMonitor::Providers::Sidekiq::Configuration::DEFAULT_RETRY_CHECK
|
102
|
+
jobs_over_limit = ::Sidekiq::RetrySet.new.select { |job| job.item['retry_count'] >= maximum_amount_of_retries }
|
103
|
+
|
104
|
+
raise "amount of retries for a job is greater than #{maximum_amount_of_retries}" if jobs_over_limit.any?
|
105
|
+
end
|
106
|
+
|
98
107
|
def check_redis!
|
99
108
|
if ::Sidekiq.respond_to?(:redis_info)
|
100
109
|
::Sidekiq.redis_info
|
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: 10.
|
4
|
+
version: 10.2.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: 2023-01
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|