Skip to content

Commit bdad15a

Browse files
committed
double restart
1 parent cdf3fc8 commit bdad15a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

subsystems/viamagent/viamagent.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (a *agentSubsystem) Update(ctx context.Context, cfg *pb.DeviceSubsystemConf
7272

7373
expectedPath := filepath.Join(agent.ViamDirs["bin"], subsysName)
7474
if runtime.GOOS == "windows" {
75-
// no systemd on windows -- check if binary is runnable, then restart service.
75+
// no systemd on windows -- check if binary is runnable, then wait for user to restart service
7676
if _, err := exec.Command(expectedPath, "--version").Output(); err != nil {
7777
return false, errw.Wrap(err, "testing binary")
7878
}
@@ -81,10 +81,10 @@ func (a *agentSubsystem) Update(ctx context.Context, cfg *pb.DeviceSubsystemConf
8181
// if _, err := exec.Command("powershell", "-command", "Restart-Service viam-agent").Output(); err != nil {
8282
// return false, errw.Wrap(err, "restarting windows service")
8383
// }
84-
if agent.GlobalCancel == nil {
85-
return false, errors.New("can't call globalCancel because it's nil")
86-
}
87-
agent.GlobalCancel()
84+
// if agent.GlobalCancel == nil {
85+
// return false, errors.New("can't call globalCancel because it's nil")
86+
// }
87+
// agent.GlobalCancel()
8888
return true, nil
8989
}
9090

0 commit comments

Comments
 (0)