rack-ratelimit 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/ratelimit.rb +4 -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: 932df83350e7eb0747d9e4e380179c0f835bbadefb4dbb62ed0e4b0837778a1d
|
4
|
+
data.tar.gz: 3d9b668665f8bb7867719ebaae2a7804bf83794651d6c1f2261ef8cc4842619e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a319c6549dc021bd7fe3c703e6d1d484cf3daf6a2df5508e6d32de251077b1a012c36118359b974fb75cf7d7e341dc60232333eb468698eae48aeb3150ccdfd0
|
7
|
+
data.tar.gz: 1612618c51f43cb09ef159822807a5e46813e44185bbf65218bf7f8301c7050ac020e1dba494a0a58d2b70408973762b9966517bc3a00fad7a819d5f9fcba211
|
data/lib/rack/ratelimit.rb
CHANGED
@@ -204,6 +204,8 @@ module Rack
|
|
204
204
|
else
|
205
205
|
@cache.incr(key, 1).to_i
|
206
206
|
end
|
207
|
+
rescue Dalli::DalliError
|
208
|
+
0
|
207
209
|
end
|
208
210
|
end
|
209
211
|
|
@@ -222,6 +224,8 @@ module Rack
|
|
222
224
|
redis.incr key
|
223
225
|
redis.expire key, @period
|
224
226
|
end.first
|
227
|
+
rescue Redis::BaseError
|
228
|
+
0
|
225
229
|
end
|
226
230
|
end
|
227
231
|
end
|