mirror of
https://github.com/matrix-org/synapse-s3-storage-provider.git
synced 2024-10-23 07:29:40 +00:00
Stop ThreadPool on exit
If we don't do this then we end up delaying shutdown by ~30s.
This commit is contained in:
parent
b4b6525be8
commit
9521804529
1 changed files with 7 additions and 0 deletions
|
@ -82,6 +82,13 @@ class S3StorageProviderBackend(StorageProvider):
|
||||||
)
|
)
|
||||||
self._download_pool.start()
|
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):
|
def store_file(self, path, file_info):
|
||||||
"""See StorageProvider.store_file"""
|
"""See StorageProvider.store_file"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue