tornado: Reduce logging of event queue load/dump.

This logging is really only potentially interesting in a development
environment when the numbers are nonzero.

In production, it seems worth logging for consistency reasons.

Probably we'll eventually redo this block by change the log level, but
this is good enough to despam the development environment startup
output.
This commit is contained in:
Tim Abbott
2020-12-20 12:13:34 -08:00
parent eca67135d1
commit 1f036f9bde

View File

@@ -471,8 +471,9 @@ def dump_event_queues(port: int) -> None:
orjson.dumps([(qid, client.to_dict()) for (qid, client) in clients.items()])
)
logging.info('Tornado %d dumped %d event queues in %.3fs',
port, len(clients), time.time() - start)
if len(clients) > 0 or settings.PRODUCTION:
logging.info('Tornado %d dumped %d event queues in %.3fs',
port, len(clients), time.time() - start)
def load_event_queues(port: int) -> None:
global clients
@@ -498,8 +499,9 @@ def load_event_queues(port: int) -> None:
add_to_client_dicts(client)
logging.info('Tornado %d loaded %d event queues in %.3fs',
port, len(clients), time.time() - start)
if len(clients) > 0 or settings.PRODUCTION:
logging.info('Tornado %d loaded %d event queues in %.3fs',
port, len(clients), time.time() - start)
def send_restart_events(immediate: bool=False) -> None:
event: Dict[str, Any] = dict(type='restart', server_generation=settings.SERVER_GENERATION)