summary refs log tree commit diff
path: root/synapse/rest/media/v1
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-02-07 13:35:08 +0000
committerErik Johnston <erik@matrix.org>2018-02-07 13:35:08 +0000
commit5fa571a91b851d372e07217c091b7e3a9ef3d116 (patch)
tree5a34184c247c34f6bd1c2f4222b039ca181f2ce3 /synapse/rest/media/v1
parentMerge pull request #2847 from matrix-org/erikj/separate_event_creation (diff)
downloadsynapse-5fa571a91b851d372e07217c091b7e3a9ef3d116.tar.xz
Tell storage providers about new file so they can upload
Diffstat (limited to 'synapse/rest/media/v1')
-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