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.
This commit is contained in:
Tim Abbott 2018-04-17 14:06:30 -07:00
parent d340c8d46d
commit 9f844ff681
2 changed files with 9 additions and 6 deletions

View File

@ -6,3 +6,5 @@ known_third_party = django, ujson, sqlalchemy
known_first_party = zerver, zproject, version, confirmation, zilencer, analytics, frontend_tests, scripts, corporate known_first_party = zerver, zproject, version, confirmation, zilencer, analytics, frontend_tests, scripts, corporate
sections = FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER sections = FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
lines_after_imports = 1 lines_after_imports = 1
# See the comment related to ioloop_logging for why this is skipped.
skip = zerver/management/commands/runtornado.py

View File

@ -9,22 +9,23 @@ from django.core.management.base import BaseCommand, \
from tornado import ioloop from tornado import ioloop
from tornado.log import app_log 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 # We must call zerver.tornado.ioloop_logging.instrument_tornado_ioloop
# before we import anything else from our project in order for our # before we import anything else from our project in order for our
# Tornado load logging to work; otherwise we might accidentally import # Tornado load logging to work; otherwise we might accidentally import
# zerver.lib.queue (which will instantiate the Tornado ioloop) before # zerver.lib.queue (which will instantiate the Tornado ioloop) before
# this. # this.
from zerver.tornado.ioloop_logging import instrument_tornado_ioloop from zerver.tornado.ioloop_logging import instrument_tornado_ioloop
from zerver.tornado.socket import respond_send_message
settings.RUNNING_INSIDE_TORNADO = True settings.RUNNING_INSIDE_TORNADO = True
instrument_tornado_ioloop() 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: if settings.USING_RABBITMQ:
from zerver.lib.queue import get_queue_client from zerver.lib.queue import get_queue_client