summaryrefslogtreecommitdiff
path: root/backend/plugin.py
diff options
context:
space:
mode:
authorTrainDoctor <traindoctor@protonmail.com>2023-01-29 13:32:58 -0800
committerTrainDoctor <traindoctor@protonmail.com>2023-01-29 13:59:02 -0800
commit2e53fb217a0e870359b48a1f2324f3f5cf30d7ec (patch)
tree5f1335e1bad920eec72b2dab24777e1f65d66ae0 /backend/plugin.py
parentc2b76d9099ac551f829f9cec821c23a9aff6b018 (diff)
downloaddecky-loader-2e53fb217a0e870359b48a1f2324f3f5cf30d7ec.tar.gz
decky-loader-2e53fb217a0e870359b48a1f2324f3f5cf30d7ec.zip
Add better handling for unloading of plugins
Diffstat (limited to 'backend/plugin.py')
-rw-r--r--backend/plugin.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/plugin.py b/backend/plugin.py
index df0efe16..883f86f4 100644
--- a/backend/plugin.py
+++ b/backend/plugin.py
@@ -92,9 +92,12 @@ class PluginWrapper:
async def _unload(self):
try:
- self.log.info("Attempting to unload " + self.name + "\n")
+ self.log.info("Attempting to unload with plugin " + self.name + "'s \"_unload function/\"" + "\n")
if hasattr(self.Plugin, "_unload"):
await self.Plugin._unload(self.Plugin)
+ self.log.info("Unloaded " + self.name + "\n")
+ else:
+ self.log.info("Could not find \"_unload\" in " + self.name + "'s main.py" + "\n")
except:
self.log.error("Failed to unload " + self.name + "!\n" + format_exc())
exit(0)
@@ -118,6 +121,7 @@ class PluginWrapper:
break
data = loads(line.decode("utf-8"))
if "stop" in data:
+ self.log.info("Calling Loader unload function.")
await self._unload()
get_event_loop().stop()
while get_event_loop().is_running():