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.
|
||||
prev := s.stats.Snapshot()
|
||||
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(interval)
|
||||
|
||||
|
@ -352,6 +353,9 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
|
|||
// Save stats for the next loop.
|
||||
prev = stats
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// StartRetentionPolicyEnforcement launches retention policy enforcement.
|
||||
|
|
Loading…
Reference in New Issue