lib/rack/throttle/time_window.rb in rack-throttle-0.4.2 vs lib/rack/throttle/time_window.rb in rack-throttle-0.5.0

- old
+ new

@@ -8,10 +8,10 @@ # @param [Rack::Request] request # @return [Boolean] def allowed?(request) return true if whitelisted?(request) count = cache_get(key = cache_key(request)).to_i + 1 rescue 1 - allowed = count <= max_per_window.to_i + allowed = count <= max_per_window(request).to_i begin cache_set(key, count) allowed rescue => e allowed = true