Stop ThreadPool on exit

If we don't do this then we end up delaying shutdown by ~30s.
This commit is contained in:
Erik Johnston 2020-10-19 17:23:39 +01:00
parent b4b6525be8
commit 9521804529

View file

@ -82,6 +82,13 @@ class S3StorageProviderBackend(StorageProvider):
)
self._download_pool.start()
# Manually stop the thread pool on shutdown. If we don't do this then
# stopping Synapse takes an extra ~30s as Python waits for the threads
# to exit.
reactor.addSystemEventTrigger(
"during", "shutdown", self._download_pool.stop,
)
def store_file(self, path, file_info):
"""See StorageProvider.store_file"""