diff options
author | Erik Johnston <erikj@jki.re> | 2018-02-12 13:52:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 13:52:58 +0000 |
commit | 1026690cd21ae92d6f7c7e3ad931ceac76e64c31 (patch) | |
tree | 7ffcd4b4cc96422dd0b4bc21b67cc40202201c83 /synapse | |
parent | Merge pull request #2858 from matrix-org/rav/purge_updates (diff) | |
parent | Tell storage providers about new file so they can upload (diff) | |
download | synapse-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.py | 6 |
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 |