Skip to content

Instantly share code, notes, and snippets.

@jerith
Created October 10, 2012 20:22
Show Gist options
  • Select an option

  • Save jerith/3868182 to your computer and use it in GitHub Desktop.

Select an option

Save jerith/3868182 to your computer and use it in GitHub Desktop.
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