founders_toolkit 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/founders_toolkit/util/rate_limitable.rb +8 -6
- data/lib/founders_toolkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cdef234a608001617a427f4b1fae7a5fba98ea5ee6167d5b4f9c100702c1ce1
|
4
|
+
data.tar.gz: 1ab17d05b93bb338ed98c38802863ba1c828687c1e9adc9260889ddb5cf619a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a22d075b2ae0b56e5d8038ba9737678c570da481e6668cdee6aeca491c09ef6d31ba08b63a24ef2e7e268f326be00e1fef9a9b77e431a645d489f63804e1494b
|
7
|
+
data.tar.gz: 28427b91f1ebc7b38b5cb95793f2f810d1a7e4efd13c9ffa8155db444d47bf737a577f5a007e20532d4edb6c811130b7f617bcb3ad3afccd13bb33ba5a53e623
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -31,13 +31,15 @@ module FoundersToolkit::Util
|
|
31
31
|
limiter = instance_variable_get("@#{limiter_name}".to_sym)
|
32
32
|
limiter ||= instance_variable_set("@#{limiter_name}".to_sym, Ratelimit.new(name))
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
Retryable.retryable(tries: 3, on: retry_from) { block.call }
|
37
|
-
end
|
38
|
-
limiter.add __send__(key)
|
39
|
-
result
|
34
|
+
statsd.time(['throttled', limiter_name].join('.')) do
|
35
|
+
sleep 1 while limiter.exceeded?(__send__(key), threshold: threshold, interval: interval)
|
40
36
|
end
|
37
|
+
|
38
|
+
result = statsd.time(['retryable', limiter_name].join('.')) do
|
39
|
+
Retryable.retryable(tries: 3, on: retry_from) { block.call }
|
40
|
+
end
|
41
|
+
limiter.add __send__(key)
|
42
|
+
result
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|