-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `maximum=' for String #8
Comments
BTW, it works fine with a memcached client. |
I think you're exactly right - looks like I've been relying on memcached doing automatic serialization, and Redis just saves a string representation rather than a proper serialized object. I'll take some time over the weekend and tweak the SlidingWindow Limiter to save more gracefully for Redis. I think the other strategies should all work fine - the obvious workarounds until I can cut a release are to use a different strategy or a different cache store (as you're obv. already doing). |
Ok, fix is ready on branch redis-compat (0e9d398) - just added Marshaling of LeakyBuckets before caching them. I did not have the opportunity yet to set up a Redis test instance to play with - I'd like to before cutting a release. Would appreciate if you get a chance to test it on your app, as that would save me the trouble. |
I tried to use another strategy before with redis. Not sure anymore, if it was successfull. But when ich changed the strategy it would reuse the same cache key. So it would try to call maximum= on a String, which was actually an ip adress or a time stamp. Not sure anymore. I think it would be a smart idea to change the keys depending on the strategy, so they do not interfere. |
Hey,
I'm trying to throttle the usage of my api only. This is the config i use:
And this is, what is happenIng:
I suspect the marshalling/unmarshalling of the LeakyBucket object does not work correctly with redis.
The text was updated successfully, but these errors were encountered: