summary refs log tree commit diff
path: root/synapse/app/_base.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2022-02-08 13:25:54 +0000
committerBrendan Abolivier <babolivier@matrix.org>2022-02-08 13:25:54 +0000
commit0b561a0ea1384db214c274f45b160c538d2ab65d (patch)
treeaad71a937464551ac28cae53e36820f669431980 /synapse/app/_base.py
parentUse changelog from develop (diff)
parentFix wording (diff)
downloadsynapse-0b561a0ea1384db214c274f45b160c538d2ab65d.tar.xz
Merge branch 'release-v1.52'
Diffstat (limited to 'synapse/app/_base.py')
-rw-r--r--synapse/app/_base.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py

index 579adbbca0..bbab8a052a 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py
@@ -16,7 +16,6 @@ import atexit import gc import logging import os -import platform import signal import socket import sys @@ -436,7 +435,8 @@ async def start(hs: "HomeServer") -> None: # before we start the listeners. module_api = hs.get_module_api() for module, config in hs.config.modules.loaded_modules: - module(config=config, api=module_api) + m = module(config=config, api=module_api) + logger.info("Loaded module %s", m) load_legacy_spam_checkers(hs) load_legacy_third_party_event_rules(hs) @@ -468,15 +468,13 @@ async def start(hs: "HomeServer") -> None: # everything currently allocated are things that will be used for the # rest of time. Doing so means less work each GC (hopefully). # - # This only works on Python 3.7 - if platform.python_implementation() == "CPython" and sys.version_info >= (3, 7): + # PyPy does not (yet?) implement gc.freeze() + if hasattr(gc, "freeze"): gc.collect() gc.freeze() - # Speed up shutdowns by freezing all allocated objects. This moves everything - # into the permanent generation and excludes them from the final GC. - # Unfortunately only works on Python 3.7 - if platform.python_implementation() == "CPython" and sys.version_info >= (3, 7): + # Speed up shutdowns by freezing all allocated objects. This moves everything + # into the permanent generation and excludes them from the final GC. atexit.register(gc.freeze)