health-monitor-rails 12.0.0 → 12.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: 27b214b33b4ea1a6deaca8dd0a2b7dfb568d4f268435dcc781074a18ce0f4be3
4
- data.tar.gz: 1610408710e79f17a8c02706ecd917f4123c6796430e50a579ed732b41b7f2b7
3
+ metadata.gz: 5a4b35be2c84bd3859456f041a978da8828cb72294d86bfab7b97dc3478134b3
4
+ data.tar.gz: a393dbc7c46777aae939589d443b67ef41abbeb238879adf4ff6985511aceda9
5
5
  SHA512:
6
- metadata.gz: 8efc25eb888dd3bdeebd2c7766824f002c52ab2516d1361f32e91581d73065c0481cbf3688bdddd108164fed76814abfece4a58e66aa5aec7cfc84c325f0be2b
7
- data.tar.gz: '048ca3f7345e38f63a4b86f5877a9e1c97864dc37c553502d2e53a7a1aa028be83dd47edf0c0c4fa39f75258d16dc3efab4fdf5c348f0afd8a7b8d708cca1c0c'
6
+ metadata.gz: 1f18d57cdf6471cf63e7ad493b4019bf1a5edfca635393aa1f35def68439dfd859b19ccf2fb3f5ab178015db46b24bf7507ed43fbc8efc8114e44d7d7e8ff736
7
+ data.tar.gz: 4da774036fbbf7e4baf0e6abb2bd7eb313282bc2ea3ca39feded6bfe0c099f2fe5549e02b799e255d9d4738d07bf80ecda5dfd2b10caa213f3f68170204d684d
@@ -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
- maximum_amount_of_retries = ::HealthMonitor::Providers::Sidekiq::Configuration::DEFAULT_RETRY_CHECK
100
- jobs_over_limit = ::Sidekiq::RetrySet.new.select { |job| job.item['retry_count'] >= maximum_amount_of_retries }
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}" if jobs_over_limit.any?
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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HealthMonitor
4
- VERSION = '12.0.0'
4
+ VERSION = '12.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: 12.0.0
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-03-25 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties