mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-10 04:26:35 +00:00
chore: added tests (#1800)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -47,7 +47,10 @@ var ConfigDefaults = Config{
|
||||
scrapeInterval: 6 * time.Hour,
|
||||
}
|
||||
|
||||
var ErrNoUpdates = errors.New("pending gather update metrics")
|
||||
var (
|
||||
ErrNoUpdates = errors.New("pending gather update metrics")
|
||||
ErrUpdateServiceDisabled = errors.New("windows updates service is disabled")
|
||||
)
|
||||
|
||||
type Collector struct {
|
||||
config Config
|
||||
@@ -234,7 +237,7 @@ func (c *Collector) scheduleUpdateStatus(ctx context.Context, logger *slog.Logge
|
||||
}(hc)
|
||||
|
||||
if err != nil {
|
||||
initErrCh <- fmt.Errorf("windows updates service is disabled: %w", err)
|
||||
initErrCh <- ErrUpdateServiceDisabled
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user