Only register a Tornado rabbitmq handler if we're using rabbitmq.

(imported from commit 726934bc9acab3b19720f6b5ab1d0736ddd96832)
This commit is contained in:
Tim Abbott
2013-05-07 18:32:33 -04:00
parent 92d6e80d57
commit 4ab4772758

View File

@@ -230,7 +230,8 @@ elif settings.USING_RABBITMQ:
def setup_tornado_rabbitmq():
# When tornado is shut down, disconnect cleanly from rabbitmq
atexit.register(lambda: queue_client.close())
if settings.USING_RABBITMQ:
atexit.register(lambda: queue_client.close())
# We using a simple lock to prevent multiple RabbitMQ messages being
# sent to the SimpleQueueClient at the same time; this is a workaround