windows service: only restart twice

reset the service failure count to zero after 3600 seconds.

Fixes #83
This commit is contained in:
Nicola Murino 2020-03-02 09:58:36 +01:00
parent 3ffddcba92
commit 7c115aa9c8

View file

@ -192,11 +192,10 @@ func (s *WindowsService) Install(args ...string) error {
Delay: 60 * time.Second,
},
{
Type: mgr.ServiceRestart,
Delay: 90 * time.Second,
Type: mgr.NoAction,
},
}
err = service.SetRecoveryActions(recoveryActions, uint32(86400))
err = service.SetRecoveryActions(recoveryActions, uint32(3600))
if err != nil {
service.Delete()
return fmt.Errorf("unable to set recovery actions: %v", err)