tornado: Move setup_tornado_rabbitmq to application.py

This commit is contained in:
Umair Khan
2017-07-21 09:55:25 +05:00
parent 4ea45743d0
commit 758dbec9e2
3 changed files with 12 additions and 9 deletions

View File

@@ -9,7 +9,6 @@ import ujson
import random
import time
import threading
import atexit
from collections import defaultdict
from zerver.lib.utils import statsd
@@ -291,12 +290,6 @@ def get_queue_client():
return queue_client
def setup_tornado_rabbitmq():
# type: () -> None
# When tornado is shut down, disconnect cleanly from rabbitmq
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
# for an issue with the pika BlockingConnection where using