diff --git a/synapse/media/media_storage.py b/synapse/media/media_storage.py index b3cd3fd8f4..c24b7a10cd 100644 --- a/synapse/media/media_storage.py +++ b/synapse/media/media_storage.py @@ -141,6 +141,8 @@ class MediaStorage: with start_active_span("writing to main media repo"): with open(fname, "wb") as f: yield f, fname + f.flush() + f.close() with start_active_span("writing to other storage providers"): spam_check = (