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