Launch self-monitoring in a go-routine
parent
43161bb5da
commit
032cfaa980
|
@ -331,6 +331,7 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
|
||||||
// Grab the initial stats.
|
// Grab the initial stats.
|
||||||
prev := s.stats.Snapshot()
|
prev := s.stats.Snapshot()
|
||||||
|
|
||||||
|
go func() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(interval)
|
time.Sleep(interval)
|
||||||
|
|
||||||
|
@ -352,6 +353,9 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
|
||||||
// Save stats for the next loop.
|
// Save stats for the next loop.
|
||||||
prev = stats
|
prev = stats
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartRetentionPolicyEnforcement launches retention policy enforcement.
|
// StartRetentionPolicyEnforcement launches retention policy enforcement.
|
||||||
|
|
Loading…
Reference in New Issue