summaryrefslogtreecommitdiff
path: root/plugin_loader/utilities.py
diff options
context:
space:
mode:
authormarios <marios8543@gmail.com>2022-04-26 23:37:01 +0300
committermarios <marios8543@gmail.com>2022-04-26 23:37:01 +0300
commitfe1f6473e9324be5a3ae7bf5c641d1a652c7b5a6 (patch)
tree80f31b440d989241628f92df4e3ba6495c767007 /plugin_loader/utilities.py
parent73559ae8c7b1eba15340bbdde00d8b2b4b31f5ff (diff)
downloaddecky-loader-fe1f6473e9324be5a3ae7bf5c641d1a652c7b5a6.tar.gz
decky-loader-fe1f6473e9324be5a3ae7bf5c641d1a652c7b5a6.zip
method call listener retry bug fix, method call response serializaiton failure fix,
- Added retry logic to the QuickAccess tab fetching in the method call listener. - Added exception handling, in case a plugin method returns something that can't be serialized as JSON. - Changed a few log calls from info to debug to prevent spam - Added a filter for asyncio base_event log records, since they get spamy and don't provide any useful info most of the time. This can be turned off with the LOG_BASE_EVENTS envar.
Diffstat (limited to 'plugin_loader/utilities.py')
-rw-r--r--plugin_loader/utilities.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin_loader/utilities.py b/plugin_loader/utilities.py
index 34032e43..fa47da79 100644
--- a/plugin_loader/utilities.py
+++ b/plugin_loader/utilities.py
@@ -19,12 +19,12 @@ class Utilities:
async def http_request(self, method="", url="", **kwargs):
async with ClientSession() as web:
- res = await web.request(method, url, **kwargs)
- return {
- "status": res.status,
- "headers": dict(res.headers),
- "body": await res.text()
- }
+ async with web.request(method, url, **kwargs) as res:
+ return {
+ "status": res.status,
+ "headers": dict(res.headers),
+ "body": await res.text()
+ }
async def ping(self, **kwargs):
return "pong"