mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
windows service: only restart twice
reset the service failure count to zero after 3600 seconds. Fixes #83
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user