From 9f844ff681187b959fb4c11d4753f80f028a30b1 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 17 Apr 2018 14:06:30 -0700 Subject: [PATCH] tornado: Fix logging of tornado activity level. This logging was apparently broken when sorting imports; it's a fairly unique thing in our codebase that this would be a problem. Prevent future regressions by adding this exception explicitly to the isort configuration. --- .isort.cfg | 2 ++ zerver/management/commands/runtornado.py | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 18dac9384a..1c7756eb8b 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -6,3 +6,5 @@ known_third_party = django, ujson, sqlalchemy known_first_party = zerver, zproject, version, confirmation, zilencer, analytics, frontend_tests, scripts, corporate sections = FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER lines_after_imports = 1 +# See the comment related to ioloop_logging for why this is skipped. +skip = zerver/management/commands/runtornado.py diff --git a/zerver/management/commands/runtornado.py b/zerver/management/commands/runtornado.py index 99a8cf791f..2cfcdf4ebf 100644 --- a/zerver/management/commands/runtornado.py +++ b/zerver/management/commands/runtornado.py @@ -9,22 +9,23 @@ from django.core.management.base import BaseCommand, \ from tornado import ioloop from tornado.log import app_log -from zerver.lib.debug import interactive_debug_listen -from zerver.tornado.application import create_tornado_application, \ - setup_tornado_rabbitmq -from zerver.tornado.event_queue import add_client_gc_hook, \ - missedmessage_hook, process_notification, setup_event_queue # We must call zerver.tornado.ioloop_logging.instrument_tornado_ioloop # before we import anything else from our project in order for our # Tornado load logging to work; otherwise we might accidentally import # zerver.lib.queue (which will instantiate the Tornado ioloop) before # this. from zerver.tornado.ioloop_logging import instrument_tornado_ioloop -from zerver.tornado.socket import respond_send_message settings.RUNNING_INSIDE_TORNADO = True instrument_tornado_ioloop() +from zerver.lib.debug import interactive_debug_listen +from zerver.tornado.application import create_tornado_application, \ + setup_tornado_rabbitmq +from zerver.tornado.event_queue import add_client_gc_hook, \ + missedmessage_hook, process_notification, setup_event_queue +from zerver.tornado.socket import respond_send_message + if settings.USING_RABBITMQ: from zerver.lib.queue import get_queue_client