File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -459,12 +459,19 @@ func (s *Shard) ready() error {
459
459
}
460
460
461
461
// LastModified returns the time when this shard was last modified.
462
+ // On error and 0 TSM files this will return time.Time{} (0001-01-01 00:00:00 +0000 UTC)
462
463
func (s * Shard ) LastModified () time.Time {
464
+ t , _ := s .LastModifiedWithErr ()
465
+ return t
466
+ }
467
+
468
+ // LastModifiedOrErr returns the time when this shard was last modified and an error.
469
+ func (s * Shard ) LastModifiedWithErr () (time.Time , error ) {
463
470
engine , err := s .Engine ()
464
471
if err != nil {
465
- return time.Time {}
472
+ return time.Time {}, err
466
473
}
467
- return engine .LastModified ()
474
+ return engine .LastModified (), nil
468
475
}
469
476
470
477
// Index returns a reference to the underlying index. It returns an error if
You can’t perform that action at this time.
0 commit comments