Use a larger, dedicated threadpool for media sending (#17564)

This commit is contained in:
Erik Johnston
2024-08-13 17:59:47 +01:00
committed by GitHub
parent 6a11bdf01d
commit a9fc1fd112
7 changed files with 48 additions and 17 deletions

View File

@@ -1166,6 +1166,12 @@ def setup_test_homeserver(
hs.get_auth_handler().validate_hash = validate_hash # type: ignore[assignment]
# We need to replace the media threadpool with the fake test threadpool.
def thread_pool() -> threadpool.ThreadPool:
return reactor.getThreadPool()
hs.get_media_sender_thread_pool = thread_pool # type: ignore[method-assign]
# Load any configured modules into the homeserver
module_api = hs.get_module_api()
for module, module_config in hs.config.modules.loaded_modules: