mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
tornado: Move setup_tornado_rabbitmq to application.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user