Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
64db043a
Commit
64db043a
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Move makedirs to thread
parent
b60859d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/media/v1/media_repository.py
+1
-2
1 addition, 2 deletions
synapse/rest/media/v1/media_repository.py
with
1 addition
and
2 deletions
synapse/rest/media/v1/media_repository.py
+
1
−
2
View file @
64db043a
...
...
@@ -98,6 +98,7 @@ class MediaRepository(object):
@staticmethod
def
_write_file_synchronously
(
source
,
fname
,
close_source
=
False
):
MediaRepository
.
_makedirs
(
fname
)
source
.
seek
(
0
)
# Ensure we read from the start of the file
with
open
(
fname
,
"
wb
"
)
as
f
:
shutil
.
copyfileobj
(
source
,
f
)
...
...
@@ -120,7 +121,6 @@ class MediaRepository(object):
string: the file path written to in the primary media store
"""
fname
=
os
.
path
.
join
(
self
.
primary_base_path
,
path
)
self
.
_makedirs
(
fname
)
# Write to the main repository
yield
make_deferred_yieldable
(
...
...
@@ -141,7 +141,6 @@ class MediaRepository(object):
"""
if
self
.
backup_base_path
:
backup_fname
=
os
.
path
.
join
(
self
.
backup_base_path
,
path
)
self
.
_makedirs
(
backup_fname
)
# We can either wait for successful writing to the backup repository
# or write in the background and immediately return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment