mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-01-09 14:39:34 -05:00
fix await
This commit is contained in:
parent
5273b83574
commit
ce0fa21f94
@ -868,7 +868,7 @@ class ProxyDaemon:
|
|||||||
media_id = mxc.path.strip("/")
|
media_id = mxc.path.strip("/")
|
||||||
file_name = request.match_info.get("file_name")
|
file_name = request.match_info.get("file_name")
|
||||||
|
|
||||||
response, decrypted_file, error = self._load_media(server_name, media_id, file_name, request)
|
response, decrypted_file, error = await self._load_media(server_name, media_id, file_name, request)
|
||||||
|
|
||||||
if response is None and decrypted_file is None and error is None:
|
if response is None and decrypted_file is None and error is None:
|
||||||
return await self.forward_to_web(request, token=client.access_token)
|
return await self.forward_to_web(request, token=client.access_token)
|
||||||
@ -1108,7 +1108,7 @@ class ProxyDaemon:
|
|||||||
return web.Response(status=503, text=str(e))
|
return web.Response(status=503, text=str(e))
|
||||||
|
|
||||||
|
|
||||||
def _load_media(self, server_name, media_id, file_name, request):
|
async def _load_media(self, server_name, media_id, file_name, request):
|
||||||
try:
|
try:
|
||||||
media_info = self.media_info[(server_name, media_id)]
|
media_info = self.media_info[(server_name, media_id)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -1116,7 +1116,7 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
if not media_info:
|
if not media_info:
|
||||||
logger.info(f"No media info found for {server_name}/{media_id}")
|
logger.info(f"No media info found for {server_name}/{media_id}")
|
||||||
return await self.forward_to_web(request)
|
return None, None, None
|
||||||
|
|
||||||
self.media_info[(server_name, media_id)] = media_info
|
self.media_info[(server_name, media_id)] = media_info
|
||||||
|
|
||||||
@ -1157,7 +1157,7 @@ class ProxyDaemon:
|
|||||||
media_id = request.match_info["media_id"]
|
media_id = request.match_info["media_id"]
|
||||||
file_name = request.match_info.get("file_name")
|
file_name = request.match_info.get("file_name")
|
||||||
|
|
||||||
response, decrypted_file, error = self._load_media(server_name, media_id, file_name, request)
|
response, decrypted_file, error = await self._load_media(server_name, media_id, file_name, request)
|
||||||
|
|
||||||
if response is None and decrypted_file is None and error is None:
|
if response is None and decrypted_file is None and error is None:
|
||||||
return await self.forward_to_web(request)
|
return await self.forward_to_web(request)
|
||||||
|
Loading…
Reference in New Issue
Block a user