update_manager: use the machine component to restart services
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
be338ad039
commit
3b27ab49f1
|
@ -23,6 +23,7 @@ from typing import (
|
|||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from .update_manager import CommandHelper
|
||||
from ..machine import Machine
|
||||
|
||||
CHANNEL_TO_TYPE = {
|
||||
"stable": "zip",
|
||||
|
@ -173,9 +174,9 @@ class AppDeploy(BaseDeploy):
|
|||
|
||||
async def _do_restart(self) -> None:
|
||||
self.notify_status("Restarting Service...")
|
||||
machine: Machine = self.server.lookup_component("machine")
|
||||
try:
|
||||
await self.cmd_helper.run_cmd(
|
||||
f"sudo systemctl restart {self.name}")
|
||||
await machine.do_service_action("restart", self.name)
|
||||
except Exception:
|
||||
if self.name == "moonraker":
|
||||
# We will always get an error when restarting moonraker
|
||||
|
|
Loading…
Reference in New Issue