1
0
Fork 0

Block sinks while getting stats

master
Philip O'Toole 9 months ago
parent b30cb18247
commit a3540d7a95

@ -178,6 +178,11 @@ func (s *Store) SetFullNeeded() error {
// Stats returns stats about the Snapshot Store.
func (s *Store) Stats() (map[string]interface{}, error) {
// Keep the store locked while we get the stats. Sinks can change the store
// in two ways: by creating a new snapshot, or by reaping old snapshots.
s.sinkMu.Lock()
defer s.sinkMu.Unlock()
snapshots, err := s.getSnapshots()
if err != nil {
return nil, err

Loading…
Cancel
Save