# HG changeset patch # User btimby # Date 1337115507 0 # Node ID 39295953624f1dabd6175bde4e58056fc9c97de9 # Parent 22831bdce9fd607daf5e4c77a90a0797ed3a1194 Redis requires and integer for a timeout (no floats) diff -r 22831bdce9fd -r 39295953624f queues/backends/redisd.py --- a/queues/backends/redisd.py Mon May 14 19:22:57 2012 +0000 +++ b/queues/backends/redisd.py Tue May 15 20:58:27 2012 +0000 @@ -7,6 +7,7 @@ from queues.backends.base import BaseQueue from queues import InvalidBackend, QueueException import os +import math try: import redis @@ -67,7 +68,9 @@ def read(self, block=False, timeout=0): try: if block: - m = self._connection.blpop(self.name, timeout=timeout) + # Redis requires an integer, so round a float UP to the nearest + # int (0.1 -> 1). + m = self._connection.blpop(self.name, timeout=int(math.ceil(timeout))) else: m = self._connection.lpop(self.name) if m is None: