diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-01-21 23:03:22 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-01-21 23:03:22 +0000 |
commit | 767bef00332a8c6df02dd319d19a1d2db9c96a59 (patch) | |
tree | ad2d28b3d53ae7bd492c20fe47b498ebafae7a11 | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff) | |
parent | a bit of debugging for media storage providers (diff) | |
download | synapse-767bef00332a8c6df02dd319d19a1d2db9c96a59.tar.xz |
Merge branch 'rav/storage_provider_debug' into matrix-org-hotfixes
-rw-r--r-- | synapse/rest/media/v1/media_storage.py | 1 | ||||
-rw-r--r-- | synapse/rest/media/v1/storage_provider.py | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py index 3b87717a5a..683a79c966 100644 --- a/synapse/rest/media/v1/media_storage.py +++ b/synapse/rest/media/v1/media_storage.py @@ -148,6 +148,7 @@ class MediaStorage(object): 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 diff --git a/synapse/rest/media/v1/storage_provider.py b/synapse/rest/media/v1/storage_provider.py index 37687ea7f4..858680be26 100644 --- a/synapse/rest/media/v1/storage_provider.py +++ b/synapse/rest/media/v1/storage_provider.py @@ -77,6 +77,9 @@ class StorageProviderWrapper(StorageProvider): 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) @@ -114,6 +117,9 @@ class FileStorageProviderBackend(StorageProvider): 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""" |