Skip to content

Commit b57c396

Browse files
committed
fix starting on windows
1 parent 218a43b commit b57c396

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Service/system-service_windows.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,14 @@ func (thisRef *WindowsService) Start() error {
209209
// 2.
210210
err := winService.Start()
211211
if err != nil {
212-
logging.Instance().LogErrorWithFields(loggingC.Fields{
213-
"method": helpersReflect.GetThisFuncName(),
214-
"message": fmt.Sprintf("%s: error starting: %s, %v", logTag, thisRef.command.Name, err),
215-
})
212+
if !strings.Contains(err.Error(), "already running") {
213+
logging.Instance().LogErrorWithFields(loggingC.Fields{
214+
"method": helpersReflect.GetThisFuncName(),
215+
"message": fmt.Sprintf("%s: error starting: %s, %v", logTag, thisRef.command.Name, aaaa),
216+
})
216217

217-
return fmt.Errorf("error starting: %s, %v", thisRef.command.Name, err)
218+
return fmt.Errorf("error starting: %s, %v", thisRef.command.Name, err)
219+
}
218220
}
219221

220222
logging.Instance().LogDebugWithFields(loggingC.Fields{

0 commit comments

Comments
 (0)