freno-client 0.8.2 → 0.8.3

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: 808823b23d76b3a540d9d17d2c6e28b428fd3cb387c941f79c749779393ac462
4
- data.tar.gz: cf58a8db9c3d7fa2bea92727b3336a62fded79081723ee5e13555a72e6d68c62
3
+ metadata.gz: 0e3f93dd3d1186c20522072cea3d306a19bf253dab7a4cd61fd2ecbf9a16fb83
4
+ data.tar.gz: 416f2d0ba15489ce73547836b13b046fafca1b6c357ab1a482c7cc0a13212720
5
5
  SHA512:
6
- metadata.gz: 1fb13835bd9d2c9dd64c8bc3ae6e9931e0bd16a82cfa0ffbc4ed276505e453d4cf8a371cd66e6a0da19c2755e1174ce2812c55d0b12ce781b7a52f08add3f838
7
- data.tar.gz: 540f2de04000141a1c636ab169e178a99a48dc19fe53557f7afba59dd2ddd2e2c407178e8a4f5e2daeb82b54871eac21f7d369854f1e9d7b87bbde1226289ffc
6
+ metadata.gz: e07318b40abf5ccb2a87af80498ce638ee2fd6fa9778e86806fd1a17905c0e3f06ae10a4eb4a0e851d22d106607d77e9a8a5d8fe766d084fe6ffca08da6ec39c
7
+ data.tar.gz: 9a902ee6324835e5758382b20dd7f4ce7e21bff6069cda917fa44b8b5b3aaa16b29bb75842f36309e92199c9d1e95a60660e6648a8ef71635851ddfb69fb537e
data/.rubocop.yml CHANGED
@@ -42,3 +42,7 @@ Style/StringLiterals:
42
42
  EnforcedStyle: double_quotes
43
43
  Style/SymbolArray:
44
44
  Enabled: false
45
+ Style/InfiniteLoop:
46
+ Enabled: false
47
+ Style/Next:
48
+ Enabled: false
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Freno
4
4
  class Client
5
- VERSION = "0.8.2"
5
+ VERSION = "0.8.3"
6
6
  end
7
7
  end
@@ -166,7 +166,7 @@ module Freno
166
166
  instrument(:called, store_names: store_names)
167
167
  waited = 0
168
168
 
169
- loop do
169
+ while true
170
170
  unless circuit_breaker.allow_request?
171
171
  instrument(:circuit_open, store_names: store_names, waited: waited)
172
172
  raise CircuitOpen
@@ -175,19 +175,21 @@ module Freno
175
175
  if all_stores_ok?(store_names, **options)
176
176
  instrument(:succeeded, store_names: store_names, waited: waited)
177
177
  circuit_breaker.success
178
- return yield
178
+ break
179
179
  end
180
180
 
181
181
  wait
182
182
  waited += wait_seconds
183
183
  instrument(:waited, store_names: store_names, waited: waited, max: max_wait_seconds)
184
184
 
185
- next unless waited > max_wait_seconds
186
-
187
- instrument(:waited_too_long, store_names: store_names, waited: waited, max: max_wait_seconds)
188
- circuit_breaker.failure
189
- raise WaitedTooLong.new(waited_seconds: waited, max_wait_seconds: max_wait_seconds)
185
+ if waited > max_wait_seconds
186
+ instrument(:waited_too_long, store_names: store_names, waited: waited, max: max_wait_seconds)
187
+ circuit_breaker.failure
188
+ raise WaitedTooLong.new(waited_seconds: waited, max_wait_seconds: max_wait_seconds)
189
+ end
190
190
  end
191
+
192
+ yield
191
193
  end
192
194
 
193
195
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freno-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-20 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.3.7
81
+ rubygems_version: 3.4.19
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: A library for interacting with Freno, the throttler service