diff options
| author | Sims <38142618+suchmememanyskill@users.noreply.github.com> | 2024-09-02 01:45:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-01 19:45:47 -0400 |
| commit | a6e4bcf0527a998261698c555113a3f652d280d9 (patch) | |
| tree | 493abbacaa997c00130d3cd13a28db07c5075dbf /backend/decky_loader/updater.py | |
| parent | c1f7ca7f2079fd5960c67d612f2551e033281051 (diff) | |
| download | decky-loader-3f0bc47194d9d3e29f9aa5edb9297c6434adfb80.tar.gz decky-loader-3f0bc47194d9d3e29f9aa5edb9297c6434adfb80.zip | |
Fix updater taking a long time (#696)v3.0.0-pre12
Replaces subprocess with asyncio.subprocess in some localplatformlinux functions and improves shutdown handling
Co-authored-by: AAGaming <aagaming@riseup.net>
Diffstat (limited to 'backend/decky_loader/updater.py')
| -rw-r--r-- | backend/decky_loader/updater.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/decky_loader/updater.py b/backend/decky_loader/updater.py index 5cd25e72..75f9618b 100644 --- a/backend/decky_loader/updater.py +++ b/backend/decky_loader/updater.py @@ -24,6 +24,7 @@ logger = getLogger("Updater") class RemoteVerAsset(TypedDict): name: str + size: int browser_download_url: str class RemoteVer(TypedDict): tag_name: str @@ -198,11 +199,13 @@ class Updater: version = self.remoteVer["tag_name"] download_url = None + size_in_bytes = None download_filename = "PluginLoader" if ON_LINUX else "PluginLoader.exe" for x in self.remoteVer["assets"]: if x["name"] == download_filename: download_url = x["browser_download_url"] + size_in_bytes = x["size"] break if download_url == None: @@ -238,10 +241,10 @@ class Updater: os.mkdir(path.join(getcwd(), ".systemd")) shutil.move(service_file_path, path.join(getcwd(), ".systemd")+"/plugin_loader.service") - await self.download_decky_binary(download_url, version) + await self.download_decky_binary(download_url, version, size_in_bytes=size_in_bytes) async def do_restart(self): - await service_restart("plugin_loader") + await service_restart("plugin_loader", block=False) async def do_shutdown(self): await service_stop("plugin_loader") |
