Skip to content

Commit

Permalink
fix: add recovery option for windows service (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
uubulb authored Jul 20, 2024
1 parent 55c4a77 commit 0a6adea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,17 @@ func runService(action string, flags []string) {
return
}

winConfig := map[string]interface{}{
"OnFailure": "restart",
}

svcConfig := &service.Config{
Name: "nezha-agent",
DisplayName: "Nezha Agent",
Description: "哪吒探针监控端",
Arguments: flags,
WorkingDirectory: dir,
Option: winConfig,
}

prg := &program{
Expand Down

0 comments on commit 0a6adea

Please sign in to comment.