Make shard is ready before returning index type
Shard can be created before they are opened and not have an index setup yet. This can cause a panic if IndexType is called.pull/8370/head
parent
041262af0e
commit
00bdf62b83
|
@ -347,6 +347,10 @@ func (s *Shard) close(clean bool) error {
|
|||
}
|
||||
|
||||
func (s *Shard) IndexType() string {
|
||||
if err := s.ready(); err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.index.Type()
|
||||
|
|
Loading…
Reference in New Issue