summaryrefslogtreecommitdiff
path: root/plugin_loader/injector.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/injector.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/injector.py')
-rw-r--r--plugin_loader/injector.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugin_loader/injector.py b/plugin_loader/injector.py
index 46831b6d..c2157472 100644
--- a/plugin_loader/injector.py
+++ b/plugin_loader/injector.py
@@ -3,6 +3,7 @@
from aiohttp import ClientSession
from logging import debug, getLogger
from asyncio import sleep
+from traceback import format_exc
BASE_ADDRESS = "http://localhost:8080"
@@ -61,14 +62,15 @@ async def get_tabs():
res = await web.get(f"{BASE_ADDRESS}/json")
break
except:
- logger.info("Steam isn't available yet. Wait for a moment...")
+ logger.debug("Steam isn't available yet. Wait for a moment...")
+ logger.debug(format_exc())
await sleep(5)
if res.status == 200:
- res = await res.json()
- return [Tab(i) for i in res]
+ r = await res.json()
+ return [Tab(i) for i in r]
else:
- raise Exception(f"/json did not return 200. {await res.text()}")
+ raise Exception(f"/json did not return 200. {await r.text()}")
async def get_tab(tab_name):
tabs = await get_tabs()