health-monitor-rails 10.0.0 → 10.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/health_monitor/providers/sidekiq.rb +9 -0
- 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: f31145948d53277b016035e3dd3b1580ccc47afc452f2a9a197141c3c96b21ad
|
4
|
+
data.tar.gz: 80f759c330d6086287abd668c6c9bf5c9666092a3ac2d8ac2f0a8439981a36ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3b4d89aa49a1d799f23ec6e98bf718a584e8c7954e1c4544d61159f0ed012609bb8eb213714cf987f52a537dd00c14bfbce6b92fa8f5f7e64b50fdf1f94310f
|
7
|
+
data.tar.gz: 6e1f95ccc047a279d7cb8658a3186de8b20ae62260ea9832beec3ca7a944522b1a91171ee3aa9c4d9ddc672f964d8c55f2f8005a036d0423281d42dc038d34a0
|
@@ -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.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: 2023-01-
|
11
|
+
date: 2023-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|