Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
a bit of debugging for media storage providers (#6757)
Browse files Browse the repository at this point in the history
* a bit of debugging for media storage providers

* changelog
  • Loading branch information
richvdh authored Jan 23, 2020
1 parent 5bd3cb7 commit 6b7462a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/6757.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some debugging for media storage providers.
1 change: 1 addition & 0 deletions synapse/rest/media/v1/media_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def fetch_media(self, file_info):
for provider in self.storage_providers:
res = yield provider.fetch(path, file_info)
if res:
logger.debug("Streaming %s from %s", path, provider)
return res

return None
Expand Down
6 changes: 6 additions & 0 deletions synapse/rest/media/v1/storage_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def __init__(self, backend, store_local, store_synchronous, store_remote):
self.store_synchronous = store_synchronous
self.store_remote = store_remote

def __str__(self):
return "StorageProviderWrapper[%s]" % (self.backend,)

def store_file(self, path, file_info):
if not file_info.server_name and not self.store_local:
return defer.succeed(None)
Expand Down Expand Up @@ -114,6 +117,9 @@ def __init__(self, hs, config):
self.cache_directory = hs.config.media_store_path
self.base_directory = config

def __str__(self):
return "FileStorageProviderBackend[%s]" % (self.base_directory,)

def store_file(self, path, file_info):
"""See StorageProvider.store_file"""

Expand Down

0 comments on commit 6b7462a

Please sign in to comment.