From f68e150f18516752aeb86222712f15d848d465cf Mon Sep 17 00:00:00 2001 From: Abe Winter Date: Sun, 12 Jan 2025 16:23:39 -0500 Subject: [PATCH] sigh double restart --- subsystems/viamagent/viamagent.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsystems/viamagent/viamagent.go b/subsystems/viamagent/viamagent.go index b83d9a0..bf2d3e0 100644 --- a/subsystems/viamagent/viamagent.go +++ b/subsystems/viamagent/viamagent.go @@ -72,7 +72,7 @@ func (a *agentSubsystem) Update(ctx context.Context, cfg *pb.DeviceSubsystemConf expectedPath := filepath.Join(agent.ViamDirs["bin"], subsysName) if runtime.GOOS == "windows" { - // no systemd on windows -- check if binary is runnable, then restart service. + // no systemd on windows -- for now you need to double-restart. if _, err := exec.Command(expectedPath, "--version").Output(); err != nil { return false, errw.Wrap(err, "testing binary") } @@ -81,10 +81,10 @@ func (a *agentSubsystem) Update(ctx context.Context, cfg *pb.DeviceSubsystemConf // if _, err := exec.Command("powershell", "-command", "Restart-Service viam-agent").Output(); err != nil { // return false, errw.Wrap(err, "restarting windows service") // } - if agent.GlobalCancel == nil { - return false, errors.New("can't call globalCancel because it's nil") - } - agent.GlobalCancel() + // if agent.GlobalCancel == nil { + // return false, errors.New("can't call globalCancel because it's nil") + // } + // agent.GlobalCancel() return true, nil }