limitlion icon indicating copy to clipboard operation
limitlion copied to clipboard

Make limitlion compatiable with redis-cluster(redis-py-cluster)

Open tarunbhardwaj opened this issue 5 years ago • 2 comments

tarunbhardwaj avatar Feb 10 '20 11:02 tarunbhardwaj

We can leave hash tag decision to caller, but we will have to make sure that hash is always provided to make this compatible with redis-cluster, as Lua script will touch other keys which might not be available in same node and that will raise error. If we ensure { } is passed we should be good. Any suggestion on handling that?

tarunbhardwaj avatar Feb 14 '20 08:02 tarunbhardwaj

After thinking about this a little more maybe leaving it to the caller isn't the best idea. At a minimum it makes the caller need to know about how hash tags are used in Redis clusters.

  • Explicitly pass in both keys to the Lua script so it is clear what is being used (less magic in the Lua script the better). So move this line to the Python side.
  • Include the prefix in the hash tag: '{{throttle:{}}}'. At some point we could allow setting the prefix and I would assume you would want them included in the hash decision.
  • Add a note to the readme that explains the use of the hash tag in the key name for use with Redis clusters.
  • We could add redis_clustering=False as an argument to throttle_configure() that can be used to enable the use of hash tags. That might make key names cleaner for non-cluster users.

Thoughts?

jkemp101 avatar Feb 17 '20 14:02 jkemp101