Auto restart Windows agent daemon service (#1819)

This enables auto restart of the windows agent daemon service on event of failure
This commit is contained in:
Maycon Santos 2024-04-10 03:10:59 +09:00 committed by GitHub
parent 22b2caffc6
commit dd0cf41147
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,6 +64,10 @@ var installCmd = &cobra.Command{
}
}
if runtime.GOOS == "windows" {
svcConfig.Option["OnFailure"] = "restart"
}
ctx, cancel := context.WithCancel(cmd.Context())
s, err := newSVC(newProgram(ctx, cancel), svcConfig)