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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rack/ratelimit.rb +4 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f495171388825bee8e7248a597406cad160d6d0fe2adfb03f9d33617ab136832
4
- data.tar.gz: 4b6256bf56d9384a80265ac5b78a9f63809e29e08bc33918b87c22ae3717cc5d
3
+ metadata.gz: 932df83350e7eb0747d9e4e380179c0f835bbadefb4dbb62ed0e4b0837778a1d
4
+ data.tar.gz: 3d9b668665f8bb7867719ebaae2a7804bf83794651d6c1f2261ef8cc4842619e
5
5
  SHA512:
6
- metadata.gz: c8eb47b3e77c43c16df7c984463366f78d0be4c5f46b425e15d027932d5d43be4771e16a8338325c631408229bc3011576daf888aaff0d021ba505a080e06a9f
7
- data.tar.gz: 467d0a44fab4f3b6490a912ad1ed8b699b315d4158a2ce709ce2743bfa16ba9c614e151d941674c2b830e4ac406ff1305fc09ee6fb2612bf7176d21477852d55
6
+ metadata.gz: a319c6549dc021bd7fe3c703e6d1d484cf3daf6a2df5508e6d32de251077b1a012c36118359b974fb75cf7d7e341dc60232333eb468698eae48aeb3150ccdfd0
7
+ data.tar.gz: 1612618c51f43cb09ef159822807a5e46813e44185bbf65218bf7f8301c7050ac020e1dba494a0a58d2b70408973762b9966517bc3a00fad7a819d5f9fcba211
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ratelimit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Daer