diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-04-27 14:18:00 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-04-27 14:18:00 +0100 |
commit | 61463323871ccbe17f8933c1695d7901cd6a8a20 (patch) | |
tree | d70648dd1b7466452da27a4b7d8993c58481ed03 /synapse/rest | |
parent | Merge branch 'develop' into rav/deferred_timeout (diff) | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-61463323871ccbe17f8933c1695d7901cd6a8a20.tar.xz |
Merge remote-tracking branch 'origin/develop' into rav/deferred_timeout
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/storage_provider.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/storage_provider.py b/synapse/rest/media/v1/storage_provider.py index c188192f2b..0252afd9d3 100644 --- a/synapse/rest/media/v1/storage_provider.py +++ b/synapse/rest/media/v1/storage_provider.py @@ -18,7 +18,7 @@ from twisted.internet import defer, threads from .media_storage import FileResponder from synapse.config._base import Config -from synapse.util.logcontext import preserve_fn +from synapse.util.logcontext import run_in_background import logging import os @@ -87,7 +87,12 @@ class StorageProviderWrapper(StorageProvider): return self.backend.store_file(path, file_info) else: # TODO: Handle errors. - preserve_fn(self.backend.store_file)(path, file_info) + def store(): + try: + return self.backend.store_file(path, file_info) + except Exception: + logger.exception("Error storing file") + run_in_background(store) return defer.succeed(None) def fetch(self, path, file_info): |