Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
0a7b0882
Unverified
Commit
0a7b0882
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix use of async/await in media code (#7184)
parent
62a72891
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/7184.misc
+1
-0
1 addition, 0 deletions
changelog.d/7184.misc
synapse/storage/data_stores/main/media_repository.py
+2
-2
2 additions, 2 deletions
synapse/storage/data_stores/main/media_repository.py
with
3 additions
and
2 deletions
changelog.d/7184.misc
0 → 100644
+
1
−
0
View file @
0a7b0882
Convert some of synapse.rest.media to async/await.
This diff is collapsed.
Click to expand it.
synapse/storage/data_stores/main/media_repository.py
+
2
−
2
View file @
0a7b0882
...
...
@@ -340,7 +340,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
"
get_expired_url_cache
"
,
_get_expired_url_cache_txn
)
def
delete_url_cache
(
self
,
media_ids
):
async
def
delete_url_cache
(
self
,
media_ids
):
if
len
(
media_ids
)
==
0
:
return
...
...
@@ -349,7 +349,7 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
def
_delete_url_cache_txn
(
txn
):
txn
.
executemany
(
sql
,
[(
media_id
,)
for
media_id
in
media_ids
])
return
self
.
db
.
runInteraction
(
"
delete_url_cache
"
,
_delete_url_cache_txn
)
return
await
self
.
db
.
runInteraction
(
"
delete_url_cache
"
,
_delete_url_cache_txn
)
def
get_url_cache_media_before
(
self
,
before_ts
):
sql
=
(
...
...
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