mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-28 09:22:06 +00:00
Merge pull request #1379 from DiniFarb/win_srv_stop_error_2
This commit is contained in:
commit
5398e91752
@ -13,9 +13,7 @@ const (
|
||||
serviceName = "windows_exporter"
|
||||
)
|
||||
|
||||
type windowsExporterService struct {
|
||||
stopCh chan<- bool
|
||||
}
|
||||
type windowsExporterService struct{}
|
||||
|
||||
var logger *eventlog.Log
|
||||
|
||||
@ -39,7 +37,6 @@ loop:
|
||||
}
|
||||
}
|
||||
}
|
||||
s.stopCh <- true
|
||||
return
|
||||
}
|
||||
|
||||
@ -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
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user