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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0502db2e6a54cf73defc3f9333fe3a157c79d8b5b2a4122fd65b6f54c48c76c5
4
- data.tar.gz: 1b1a0591c7660abf3d38f8b0dd5c21761125f5a9da46bfc3283b2a46f49d40a8
3
+ metadata.gz: f31145948d53277b016035e3dd3b1580ccc47afc452f2a9a197141c3c96b21ad
4
+ data.tar.gz: 80f759c330d6086287abd668c6c9bf5c9666092a3ac2d8ac2f0a8439981a36ff
5
5
  SHA512:
6
- metadata.gz: cc7cd0673bf3c88b9ba7e146c171aee8a98630205b65b1603e1ed39b161bb288cd76a0875ea977725a30bf8914adb4a60232d71be6882e7c865239c364931af2
7
- data.tar.gz: bb1e311ee5dabda3fa4c1bd141467caf1c7469ba1c1873189e5f3c165ad8c7387c930ccdb94122fcce6d54359a7ae84dea58d3f200b1ce14a51616030589fb9f
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HealthMonitor
4
- VERSION = '10.0.0'
4
+ VERSION = '10.1.0'
5
5
  end
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.0.0
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 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties