Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2857 from matrix-org/erikj/upload_store
Browse files Browse the repository at this point in the history
Tell storage providers about new file so they can upload
  • Loading branch information
erikjohnston authored Feb 12, 2018
2 parents 10b34db + 5fa571a commit 1026690
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/rest/media/v1/media_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ def store_file(self, source, file_info):
_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
Expand Down

0 comments on commit 1026690

Please sign in to comment.