You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, it's unfortunate that different cache stores have inconsistent arities.
One workaround is to use your own cache store class as a wrapper for the Redis store. See this gist as an example.
I'd welcome a patch to the Rack::Attack::Cache#count method to support redis store. That seems like a good place to iron out the idiosyncrasies between cache stores.
You could check the store.method(:increment).arity, and store.respond_to?(:expire); or check if store.is_a?(ActiveSupport::Cache::RedisStore).
I'd like to use this gem, but use Redis as my cache for throttling. I'm using the redis-activesupport gem, and this line: https://github.com/kickstarter/rack-attack/blob/master/lib/rack/attack/cache.rb#L15 seems to be throwing an error because the Redis activesupport class doesn't accept a third arg for options, seen here: https://github.com/jodosha/redis-store/blob/master/redis-activesupport/lib/active_support/cache/redis_store.rb#L93
I'd be willing to work on a fix, but I'm not really sure what to do given there seems to be a lack of standard here.
The text was updated successfully, but these errors were encountered: