Skip to content

Commit

Permalink
Merge pull request #1379 from DiniFarb/win_srv_stop_error_2
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored Jan 9, 2024
2 parents 856389e + 3868c97 commit 5398e91
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/initiate/initiate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ const (
serviceName = "windows_exporter"
)

type windowsExporterService struct {
stopCh chan<- bool
}
type windowsExporterService struct{}

var logger *eventlog.Log

Expand All @@ -39,7 +37,6 @@ loop:
}
}
}
s.stopCh <- true
return
}

Expand All @@ -63,10 +60,11 @@ func init() {
}
_ = logger.Info(100, "Attempting to start exporter service")
go func() {
err = svc.Run(serviceName, &windowsExporterService{stopCh: StopCh})
err = svc.Run(serviceName, &windowsExporterService{})
if err != nil {
_ = logger.Error(102, fmt.Sprintf("Failed to start service: %v", err))
}
StopCh <- true
}()
}
}

0 comments on commit 5398e91

Please sign in to comment.