Created
October 10, 2012 20:22
-
-
Save jerith/3868182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/vumi/persist/txredis_manager.py b/vumi/persist/txredis_manager.py | |
| index f4ba173..9cacc95 100644 | |
| --- a/vumi/persist/txredis_manager.py | |
| +++ b/vumi/persist/txredis_manager.py | |
| @@ -87,6 +87,14 @@ class VumiRedis(txr.Redis): | |
| withscores=withscores, | |
| reverse=desc) | |
| + def zrangebyscore(self, name, min, max, start=None, num=None, | |
| + withscores=False, score_cast_func=float): | |
| + d = super(VumiRedis, self).zrangebyscore( | |
| + key, min, max, offset=start, count=num, withscores=withscores) | |
| + if withscores: | |
| + d.addCallback(lambda r: [(v, score_cast_func(s)) for v, s in r]) | |
| + return d | |
| + | |
| class VumiRedisClientFactory(txr.RedisClientFactory): | |
| protocol = VumiRedis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment