|
24 | 24 | except ImportError:
|
25 | 25 | from redis import Redis
|
26 | 26 | from redis.exceptions import ConnectionError
|
| 27 | + from redis.exceptions import TimeoutError |
27 | 28 | except ImportError:
|
28 |
| - ConnectionPool = Redis = ConnectionError = None |
| 29 | + ConnectionPool = Redis = ConnectionError = TimeoutError = None |
29 | 30 |
|
30 | 31 | from huey.constants import EmptyData
|
31 | 32 | from huey.exceptions import ConfigurationError
|
@@ -420,7 +421,7 @@ def dequeue(self):
|
420 | 421 | return self.conn.brpop(
|
421 | 422 | self.queue_key,
|
422 | 423 | timeout=self.read_timeout)[1]
|
423 |
| - except (ConnectionError, TypeError, IndexError): |
| 424 | + except (ConnectionError, TimeoutError, TypeError, IndexError): |
424 | 425 | # Unfortunately, there is no way to differentiate a socket
|
425 | 426 | # timing out and a host being unreachable.
|
426 | 427 | return None
|
@@ -574,7 +575,7 @@ def dequeue(self):
|
574 | 575 | _, res, _ = self.conn.bzpopmin(
|
575 | 576 | self.queue_key,
|
576 | 577 | timeout=self.read_timeout)
|
577 |
| - except (ConnectionError, TypeError, IndexError): |
| 578 | + except (ConnectionError, TimeoutError, TypeError, IndexError): |
578 | 579 | # Unfortunately, there is no way to differentiate a socket
|
579 | 580 | # timing out and a host being unreachable.
|
580 | 581 | return
|
|
0 commit comments