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 +4 -4
- data/.rubocop.yml +4 -0
- data/lib/freno/client/version.rb +1 -1
- data/lib/freno/throttler.rb +9 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e3f93dd3d1186c20522072cea3d306a19bf253dab7a4cd61fd2ecbf9a16fb83
|
4
|
+
data.tar.gz: 416f2d0ba15489ce73547836b13b046fafca1b6c357ab1a482c7cc0a13212720
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e07318b40abf5ccb2a87af80498ce638ee2fd6fa9778e86806fd1a17905c0e3f06ae10a4eb4a0e851d22d106607d77e9a8a5d8fe766d084fe6ffca08da6ec39c
|
7
|
+
data.tar.gz: 9a902ee6324835e5758382b20dd7f4ce7e21bff6069cda917fa44b8b5b3aaa16b29bb75842f36309e92199c9d1e95a60660e6648a8ef71635851ddfb69fb537e
|
data/.rubocop.yml
CHANGED
data/lib/freno/client/version.rb
CHANGED
data/lib/freno/throttler.rb
CHANGED
@@ -166,7 +166,7 @@ module Freno
|
|
166
166
|
instrument(:called, store_names: store_names)
|
167
167
|
waited = 0
|
168
168
|
|
169
|
-
|
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
|
-
|
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
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
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.
|
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:
|
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.
|
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
|