web: clarify docker restart update messaging

This commit is contained in:
Yellowcooln
2026-05-18 12:40:43 -04:00
parent 7b6babd9f5
commit ab8ae30e7d
2 changed files with 18 additions and 3 deletions
+10 -1
View File
@@ -83,6 +83,15 @@ def _schedule_container_exit(delay_seconds: float = _CONTAINER_RESTART_DELAY_SEC
threading.Thread(target=_exit_process, name="container-restart-exit", daemon=True).start()
def get_container_restart_message() -> str:
"""Return the user-facing restart message for containerized installs."""
return (
"Container restart initiated. "
"If you are running pyMC Repeater via Docker or Home Assistant, pull or rebuild "
"a newer image for packaged image updates to take effect."
)
def restart_service() -> Tuple[bool, str]:
"""
Restart the pymc-repeater service.
@@ -98,7 +107,7 @@ def restart_service() -> Tuple[bool, str]:
if is_container():
_schedule_container_exit()
logger.info("Container environment detected; scheduled process exit for container restart")
return True, "Container restart initiated"
return True, get_container_restart_message()
if is_buildroot():
if not os.path.exists(INIT_SCRIPT):
+8 -2
View File
@@ -29,7 +29,7 @@ from datetime import datetime
from typing import List, Optional
import cherrypy
from repeater.service_utils import is_buildroot
from repeater.service_utils import get_container_restart_message, is_buildroot, is_container
logger = logging.getLogger("HTTPServer")
@@ -891,7 +891,13 @@ def _do_install() -> None:
restart_msg = str(exc)
logger.warning(f"[Update] Could not restart service: {exc}")
if restart_ok:
_state.finish_install(True, f"Upgraded to latest on channel '{channel}' service restarted")
if is_container():
_state.finish_install(
True,
f"Upgraded to latest on channel '{channel}' {get_container_restart_message()}",
)
else:
_state.finish_install(True, f"Upgraded to latest on channel '{channel}' service restarted")
else:
_state.finish_install(False, f"Upgrade succeeded but service restart failed: {restart_msg}")
else: