Avoid restarting API during installs

This commit is contained in:
Aaron
2025-12-14 19:01:46 -05:00
parent 86438b11f3
commit 8557140193

View File

@@ -536,8 +536,9 @@ def _install_manifest(manifest: Dict[str, Any], meta: Optional[Dict[str, Any]],
shutil.rmtree(API_PACKAGE_DIR, ignore_errors=True) shutil.rmtree(API_PACKAGE_DIR, ignore_errors=True)
shutil.copytree(staged_pkg, API_PACKAGE_DIR, dirs_exist_ok=True) shutil.copytree(staged_pkg, API_PACKAGE_DIR, dirs_exist_ok=True)
for svc in ("pikit-api.service", "dietpi-dashboard-frontend.service"): # Restart frontend to pick up new assets; avoid restarting this API process
subprocess.run(["systemctl", "restart", svc], check=False) # mid-apply to prevent leaving state in_progress.
subprocess.run(["systemctl", "restart", "dietpi-dashboard-frontend.service"], check=False)
VERSION_FILE.parent.mkdir(parents=True, exist_ok=True) VERSION_FILE.parent.mkdir(parents=True, exist_ok=True)
VERSION_FILE.write_text(str(latest)) VERSION_FILE.write_text(str(latest))