diff options
author | Ask Solem <ask@celeryproject.org> | 2012-07-09 16:39:44 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-07-09 16:39:44 +0100 |
commit | cd7c21ecec002390909b55e43c7c310e282814f1 (patch) | |
tree | c4f125fa6229317b6ab23097f2b749e6a69d68c2 | |
parent | c151155a33f26b7c2a940aa86f7b517035744995 (diff) | |
download | kombu-cd7c21ecec002390909b55e43c7c310e282814f1.tar.gz |
Set x-expires=10 for pidbox reply queues
-rw-r--r-- | kombu/pidbox.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kombu/pidbox.py b/kombu/pidbox.py index 5c599a00..97d81b60 100644 --- a/kombu/pidbox.py +++ b/kombu/pidbox.py @@ -20,6 +20,10 @@ from .entity import Exchange, Queue from .messaging import Consumer, Producer from .utils import kwdict, uuid +#: Must be the same at both producer and consumer, +#: so probably not a good idea to change this(!) +REPLY_QUEUE_EXPIRES = 10 + __all__ = ['Node', 'Mailbox'] @@ -166,7 +170,10 @@ class Mailbox(object): exchange=self.reply_exchange, routing_key=ticket, durable=False, - auto_delete=True) + auto_delete=True, + queue_arguments={ + 'x-expires': int(REPLY_QUEUE_EXPIRES * 1000), + }) def get_queue(self, hostname): return Queue('%s.%s.pidbox' % (hostname, self.namespace), |