mirror of
https://github.com/element-hq/synapse
synced 2024-09-12 11:45:11 +00:00
a bit of debugging for media storage providers (#6757)
* a bit of debugging for media storage providers * changelog
This commit is contained in:
parent
5bd3cb7260
commit
6b7462a13f
3 changed files with 8 additions and 0 deletions
1
changelog.d/6757.misc
Normal file
1
changelog.d/6757.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Add some debugging for media storage providers.
|
|
@ -148,6 +148,7 @@ class MediaStorage(object):
|
||||||
for provider in self.storage_providers:
|
for provider in self.storage_providers:
|
||||||
res = yield provider.fetch(path, file_info)
|
res = yield provider.fetch(path, file_info)
|
||||||
if res:
|
if res:
|
||||||
|
logger.debug("Streaming %s from %s", path, provider)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -77,6 +77,9 @@ class StorageProviderWrapper(StorageProvider):
|
||||||
self.store_synchronous = store_synchronous
|
self.store_synchronous = store_synchronous
|
||||||
self.store_remote = store_remote
|
self.store_remote = store_remote
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "StorageProviderWrapper[%s]" % (self.backend,)
|
||||||
|
|
||||||
def store_file(self, path, file_info):
|
def store_file(self, path, file_info):
|
||||||
if not file_info.server_name and not self.store_local:
|
if not file_info.server_name and not self.store_local:
|
||||||
return defer.succeed(None)
|
return defer.succeed(None)
|
||||||
|
@ -114,6 +117,9 @@ class FileStorageProviderBackend(StorageProvider):
|
||||||
self.cache_directory = hs.config.media_store_path
|
self.cache_directory = hs.config.media_store_path
|
||||||
self.base_directory = config
|
self.base_directory = config
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "FileStorageProviderBackend[%s]" % (self.base_directory,)
|
||||||
|
|
||||||
def store_file(self, path, file_info):
|
def store_file(self, path, file_info):
|
||||||
"""See StorageProvider.store_file"""
|
"""See StorageProvider.store_file"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue