Don't initialize SimpleQueueClient inside Tornado.

Previously we had several files which initialized SimpleQueueClient()
for sending items to the UserActivity queue, even though those code
paths aren't used outside Tornado.  This resulted in slower Tornado
startup times.

(imported from commit ad97021ec18d3927233744037c548c22db33c321)
This commit is contained in:
Tim Abbott 2013-03-25 15:21:12 -04:00
parent 1df99937a9
commit 16574806f5
2 changed files with 2 additions and 2 deletions

View File

@ -535,7 +535,7 @@ def do_update_user_presence(user_profile, client, log_time, status):
if settings.USING_RABBITMQ or settings.TEST_SUITE:
# RabbitMQ is required for idle and unread functionality
if settings.USING_RABBITMQ:
if settings.USING_RABBITMQ and not settings.RUNNING_INSIDE_TORNADO:
actions_queue = SimpleQueueClient()
def update_user_presence(user_profile, client, log_time, status):

View File

@ -269,7 +269,7 @@ def send_notification_http(data):
def send_notification_rabbitmq(data):
notification_queue.json_publish('notify_tornado', data)
if settings.USING_RABBITMQ:
if settings.USING_RABBITMQ and not settings.RUNNING_INSIDE_TORNADO:
notification_queue = SimpleQueueClient()
send_notification = send_notification_rabbitmq
else: