Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,19 @@ func (s *Shard) ready() error {
}

// LastModified returns the time when this shard was last modified.
// On error and 0 TSM files this will return time.Time{} (0001-01-01 00:00:00 +0000 UTC)
func (s *Shard) LastModified() time.Time {
t, _ := s.LastModifiedWithErr()
return t
}

// LastModifiedOrErr returns the time when this shard was last modified and an error.
func (s *Shard) LastModifiedWithErr() (time.Time, error) {
engine, err := s.Engine()
if err != nil {
return time.Time{}
return time.Time{}, err
}
return engine.LastModified()
return engine.LastModified(), nil
}

// Index returns a reference to the underlying index. It returns an error if
Expand Down