Merge pull request #43 from matrix-org/erikj/stop_thread_pool

Stop ThreadPool on exit
This commit is contained in:
Erik Johnston 2020-10-19 20:35:10 +01:00 committed by GitHub
commit e1680af511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"""