summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-02-12 13:52:58 +0000
committerGitHub <noreply@github.com>2018-02-12 13:52:58 +0000
commit1026690cd21ae92d6f7c7e3ad931ceac76e64c31 (patch)
tree7ffcd4b4cc96422dd0b4bc21b67cc40202201c83 /synapse
parentMerge pull request #2858 from matrix-org/rav/purge_updates (diff)
parentTell storage providers about new file so they can upload (diff)
downloadsynapse-1026690cd21ae92d6f7c7e3ad931ceac76e64c31.tar.xz
Merge pull request #2857 from matrix-org/erikj/upload_store
Tell storage providers about new file so they can upload
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/media/v1/media_storage.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py
index e8e8b3986d..3f8d4b9c22 100644
--- a/synapse/rest/media/v1/media_storage.py
+++ b/synapse/rest/media/v1/media_storage.py
@@ -70,6 +70,12 @@ class MediaStorage(object):
             _write_file_synchronously, source, fname,
         ))
 
+        # Tell the storage providers about the new file. They'll decide
+        # if they should upload it and whether to do so synchronously
+        # or not.
+        for provider in self.storage_providers:
+            yield provider.store_file(path, file_info)
+
         defer.returnValue(fname)
 
     @contextlib.contextmanager