We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 181d133 commit afdbd16Copy full SHA for afdbd16
1 file changed
tsdb/shard.go
@@ -606,12 +606,19 @@ func (s *Shard) ready() error {
606
}
607
608
// LastModified returns the time when this shard was last modified.
609
+// On error and 0 TSM files this will return time.Time{} (0001-01-01 00:00:00 +0000 UTC)
610
func (s *Shard) LastModified() time.Time {
611
+ t, _ := s.LastModifiedWithErr()
612
+ return t
613
+}
614
+
615
+// LastModifiedOrErr returns the time when this shard was last modified and an error.
616
+func (s *Shard) LastModifiedWithErr() (time.Time, error) {
617
engine, err := s.Engine()
618
if err != nil {
- return time.Time{}
619
+ return time.Time{}, err
620
- return engine.LastModified()
621
+ return engine.LastModified(), nil
622
623
624
// Index returns a reference to the underlying index. It returns an error if
0 commit comments