File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,30 @@ func (thisRef *windowsService) Install() error {
161
161
},
162
162
thisRef .serviceSpec .Args ... ,
163
163
)
164
+
165
+ winService .SetRecoveryActions ([]svcMgr.RecoveryAction {
166
+ svcMgr.RecoveryAction {
167
+ Type : svcMgr .ServiceRestart ,
168
+ Delay : time .Duration (thisRef .serviceSpec .Start .RestartTimeout ) * time .Second ,
169
+ },
170
+ svcMgr.RecoveryAction {
171
+ Type : svcMgr .ServiceRestart ,
172
+ Delay : time .Duration (thisRef .serviceSpec .Start .RestartTimeout ) * time .Second ,
173
+ },
174
+ svcMgr.RecoveryAction {
175
+ Type : svcMgr .ServiceRestart ,
176
+ Delay : time .Duration (thisRef .serviceSpec .Start .RestartTimeout ) * time .Second ,
177
+ },
178
+ svcMgr.RecoveryAction {
179
+ Type : svcMgr .ServiceRestart ,
180
+ Delay : time .Duration (thisRef .serviceSpec .Start .RestartTimeout ) * time .Second ,
181
+ },
182
+ svcMgr.RecoveryAction {
183
+ Type : svcMgr .ServiceRestart ,
184
+ Delay : time .Duration (thisRef .serviceSpec .Start .RestartTimeout ) * time .Second ,
185
+ },
186
+ }, 0 )
187
+
164
188
if err != nil {
165
189
if winService != nil {
166
190
winService .Close ()
You can’t perform that action at this time.
0 commit comments