semian 0.11.7 → 0.11.8

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: e136dd51d96e89f74e2ea3b4d838a86a265dd097c44c61601daa35dbdf60aba0
4
- data.tar.gz: 9f42e7eba02dc6f94547d5a8c98ace41672abc9c4ec4ce093c5c8e4c160163a2
3
+ metadata.gz: 7b5e836c65bee18b5d62d92e165cd34c9beafa0d42c2c408138594d3720abb4d
4
+ data.tar.gz: 9ba054d5523c916729b2438cefad336305a1ec6818c57a21359f0e9645579050
5
5
  SHA512:
6
- metadata.gz: dd3861895b3aaf7de70a693c55276d9fc290cfd51a0460491759d106e0a9b9ea1d72bfbb7c3d31b7cf44bdbde3d2c7ce28742a25032375432c570aef325164da
7
- data.tar.gz: 6cad2df1f48a514ee8b0122ce1b15fa9c6af84c76dfa0b435205086f6fd1d70d60c87f00eb33282caffab8bafb4500d5a099e8a4a599d3905064d6f89e555d4b
6
+ metadata.gz: 370d75f2276562f2e4b0fda0732a0f2d9faa84259fd0ca8fb1f3eb4e11be98550e17f1dab5a9258333240f0db48316df6115b5e5b184344f2ec3f4438e421c37
7
+ data.tar.gz: d49a1d3abe581d78634986c3f735134a6d11a84721d97f8807cf205df76ee1a37e4864372927e6554826c8b5d74ca2d1286856a73a264e4e1e85c9e82c164902
@@ -7,10 +7,11 @@ module Semian
7
7
  attr_reader :name, :half_open_resource_timeout, :error_timeout, :state, :last_error
8
8
 
9
9
  def initialize(name, exceptions:, success_threshold:, error_threshold:,
10
- error_timeout:, implementation:, half_open_resource_timeout: nil)
10
+ error_timeout:, implementation:, half_open_resource_timeout: nil, error_threshold_timeout: nil)
11
11
  @name = name.to_sym
12
12
  @success_count_threshold = success_threshold
13
13
  @error_count_threshold = error_threshold
14
+ @error_threshold_timeout = error_threshold_timeout || error_timeout
14
15
  @error_timeout = error_timeout
15
16
  @exceptions = exceptions
16
17
  @half_open_resource_timeout = half_open_resource_timeout
@@ -124,7 +125,7 @@ module Semian
124
125
  end
125
126
 
126
127
  def push_time(window, time: Time.now)
127
- window.reject! { |err_time| err_time + @error_timeout < time.to_i }
128
+ window.reject! { |err_time| err_time + @error_threshold_timeout < time.to_i }
128
129
  window << time.to_i
129
130
  end
130
131
 
@@ -1,3 +1,3 @@
1
1
  module Semian
2
- VERSION = '0.11.7'
2
+ VERSION = '0.11.8'
3
3
  end
data/lib/semian.rb CHANGED
@@ -257,6 +257,7 @@ module Semian
257
257
  name,
258
258
  success_threshold: options[:success_threshold],
259
259
  error_threshold: options[:error_threshold],
260
+ error_threshold_timeout: options[:error_threshold_timeout],
260
261
  error_timeout: options[:error_timeout],
261
262
  exceptions: Array(exceptions) + [::Semian::BaseError],
262
263
  half_open_resource_timeout: options[:half_open_resource_timeout],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.7
4
+ version: 0.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Francis