summary refs log tree commit diff
path: root/synapse/rest/media/v1/media_storage.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-09-28 11:55:53 +0100
committerErik Johnston <erik@matrix.org>2021-09-28 11:55:53 +0100
commitba3a888a05f08be0a084838d3324523687eb3236 (patch)
tree9e740d3ad63c48e8c338fc6a0447ab3547463441 /synapse/rest/media/v1/media_storage.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentEncode JSON responses on a thread in C, mk2 (#10905) (diff)
downloadsynapse-ba3a888a05f08be0a084838d3324523687eb3236.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/rest/media/v1/media_storage.py')
-rw-r--r--synapse/rest/media/v1/media_storage.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py

index 01fada8fb5..fca239d8c7 100644 --- a/synapse/rest/media/v1/media_storage.py +++ b/synapse/rest/media/v1/media_storage.py
@@ -132,8 +132,7 @@ class MediaStorage: fname = os.path.join(self.local_media_directory, path) dirname = os.path.dirname(fname) - if not os.path.exists(dirname): - os.makedirs(dirname) + os.makedirs(dirname, exist_ok=True) finished_called = [False] @@ -244,8 +243,7 @@ class MediaStorage: return legacy_local_path dirname = os.path.dirname(local_path) - if not os.path.exists(dirname): - os.makedirs(dirname) + os.makedirs(dirname, exist_ok=True) for provider in self.storage_providers: res: Any = await provider.fetch(path, file_info)