Skip to content
Snippets Groups Projects
Commit 54f87e07 authored by Brendan Abolivier's avatar Brendan Abolivier
Browse files

Move media_repository's bg updates to a dedicated store

parent cef9f675
No related branches found
No related tags found
No related merge requests found
...@@ -15,11 +15,10 @@ ...@@ -15,11 +15,10 @@
from synapse.storage.background_updates import BackgroundUpdateStore from synapse.storage.background_updates import BackgroundUpdateStore
class MediaRepositoryStore(BackgroundUpdateStore): class MediaRepositoryBackgroundUpdateStore(BackgroundUpdateStore):
"""Persistence for attachments and avatars"""
def __init__(self, db_conn, hs): def __init__(self, db_conn, hs):
super(MediaRepositoryStore, self).__init__(db_conn, hs) super(MediaRepositoryBackgroundUpdateStore, self).__init__(db_conn, hs)
self.register_background_index_update( self.register_background_index_update(
update_name="local_media_repository_url_idx", update_name="local_media_repository_url_idx",
...@@ -29,6 +28,13 @@ class MediaRepositoryStore(BackgroundUpdateStore): ...@@ -29,6 +28,13 @@ class MediaRepositoryStore(BackgroundUpdateStore):
where_clause="url_cache IS NOT NULL", where_clause="url_cache IS NOT NULL",
) )
class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
"""Persistence for attachments and avatars"""
def __init__(self, db_conn, hs):
super(MediaRepositoryStore, self).__init__(db_conn, hs)
def get_local_media(self, media_id): def get_local_media(self, media_id):
"""Get the metadata for a local piece of media """Get the metadata for a local piece of media
Returns: Returns:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment