Skip to content

Commit c168e1e

Browse files
Add check for the wait
1 parent 56a9454 commit c168e1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

collector/pkg/collector/metrics.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ func (mc *MetricsCollector) Run() error {
9191
//go mc.Collect(&wg, device.WWN, device.DeviceName, device.DeviceType)
9292
mc.Collect(device.WWN, device.DeviceName, device.DeviceType)
9393

94-
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Millisecond)
94+
if mc.config.GetInt("commands.metrics_smartctl_wait") > 0 {
95+
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Millisecond)
96+
}
9597
}
9698

9799
//mc.logger.Infoln("Main: Waiting for workers to finish")

0 commit comments

Comments
 (0)