Avoid restarting API during installs
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user