summaryrefslogtreecommitdiff
path: root/backend/decky_loader/main.py
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2024-07-03 20:43:08 -0400
committerAAGaming <aagaming@riseup.net>2024-07-03 20:43:08 -0400
commitf5eba51c523722eeafae6742dcc5faed09b25b2f (patch)
tree3b6b7ee48d57fde058b1b8e6efe77a2ce8bf1a44 /backend/decky_loader/main.py
parent83972972f306617b414204d4ff095ca7c0e318f4 (diff)
downloaddecky-loader-f5eba51c523722eeafae6742dcc5faed09b25b2f.tar.gz
decky-loader-f5eba51c523722eeafae6742dcc5faed09b25b2f.zip
set process/thread titles for decky and plugins
sadly requires the `setproctitle` pypi module because python doesn't have a builtin to do this :/
Diffstat (limited to 'backend/decky_loader/main.py')
-rw-r--r--backend/decky_loader/main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/decky_loader/main.py b/backend/decky_loader/main.py
index a9b78026..a6a61cef 100644
--- a/backend/decky_loader/main.py
+++ b/backend/decky_loader/main.py
@@ -19,6 +19,7 @@ import aiohttp_cors # pyright: ignore [reportMissingTypeStubs]
from aiohttp import client_exceptions
from aiohttp.web import Application, Response, Request, get, run_app, static # pyright: ignore [reportUnknownVariableType]
from aiohttp_jinja2 import setup as jinja_setup
+from setproctitle import getproctitle, setproctitle, setthreadtitle
# local modules
from .browser import PluginBrowser
@@ -216,6 +217,8 @@ class PluginManager:
run_app(self.web_app, host=get_server_host(), port=get_server_port(), loop=self.loop, access_log=None, handle_signals=False, shutdown_timeout=15)
def main():
+ setproctitle(f"Decky Loader {get_loader_version()} ({getproctitle()})")
+ setthreadtitle("Decky Loader")
if ON_WINDOWS:
# Fix windows/flask not recognising that .js means 'application/javascript'
import mimetypes
@@ -224,8 +227,8 @@ def main():
# Required for multiprocessing support in frozen files
multiprocessing.freeze_support()
else:
- if get_effective_user_id() != 0:
- logger.warning(f"decky is running as an unprivileged user, this is not officially supported and may cause issues")
+ if get_effective_user_id() != 0:
+ logger.warning(f"decky is running as an unprivileged user, this is not officially supported and may cause issues")
# Append the system and user python paths
sys.path.extend(get_system_pythonpaths())