rapidity 0.0.2.59005 → 0.0.2.59006
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rapidity/limiter.rb +2 -0
- 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: 52c3b13fc375998d489d1d4ad9d8099dcbeab6ad9aa65c20bce1d49193a5ea0f
|
4
|
+
data.tar.gz: cc5da7d8397f34feffc4bbf96a8f7466ecdd542462c3f473151b8afab7b30c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626c35d1e78b655107d510d930e1b6a16bebce3edc4a2250cc060717ed5d62dd8619a00441d9cf21e5f0ec9b8d12eaa03f8a1fa0e47162fbaad678fb59e8bb1c
|
7
|
+
data.tar.gz: 92d2881827bd9d550a856733b0d816df83c4e44bbebd58909698a937e12a8997bfd99b56727dc023561c01079c0f2445b61193ac811bc8b4c2fea2179d9103ad
|
data/Gemfile.lock
CHANGED
data/lib/rapidity/limiter.rb
CHANGED
@@ -41,6 +41,8 @@ module Rapidity
|
|
41
41
|
# Obtain values from counter
|
42
42
|
# @return count succesfuly obtained send slots
|
43
43
|
def obtain(count = 5)
|
44
|
+
count = count.abs
|
45
|
+
|
44
46
|
_, taken = @pool.with do |conn|
|
45
47
|
conn.multi do
|
46
48
|
conn.set(key('remains'), threshold, ex: interval, nx: true)
|