better_rate_limit 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/better_rate_limit/throttle.rb +1 -1
- data/lib/better_rate_limit/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: 9eedeebfe87d1f95a4541b994bcabec39ac02250827174c12da04b612209e4f6
|
4
|
+
data.tar.gz: 0aee3a1cf32a3e59c8b1307dd6364f6610272366267d4c59644741df3d9006b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 162d31096ed6a08dc8ca38b18becb34512f25abd99297bd9b03ac7dd0208499dea1fd8ba2871584a9929ba45555734e8a8611c2b3d64df663b3a60128f007ae3
|
7
|
+
data.tar.gz: b28194386480e1ec62fca06ea62ba8de6ec41eedae07d97710e9afb1bf5af09923fe5f1465a93f3cd85c167f5c18300f74b8242e35eeffed95af66a165ec7c8a
|
@@ -10,8 +10,8 @@ module BetterRateLimit
|
|
10
10
|
|
11
11
|
class << self
|
12
12
|
def throttle(key, limit:, time_window:)
|
13
|
-
raise MissingRedisConfigError unless redis_client
|
14
13
|
return true if BetterRateLimit.configuration.ignore
|
14
|
+
raise MissingRedisConfigError unless redis_client
|
15
15
|
|
16
16
|
now = Time.now.utc
|
17
17
|
timestamps_count = redis_client.llen key
|