mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
remove unneccessary file opens
This commit is contained in:
parent
2742ac351c
commit
8a59c1f930
2 changed files with 1 additions and 14 deletions
|
|
@ -399,13 +399,6 @@ func (h *Holder) Open() error {
|
|||
return errors.Wrap(err, "getting schema")
|
||||
}
|
||||
|
||||
// Open path to read all index directories.
|
||||
f, err := os.Open(h.IndexesPath())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "opening directory")
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
for idxKey, idx := range schema {
|
||||
// decode the CreateIndexMessage from the schema data in order to
|
||||
// get its metadata, such as CreateAt.
|
||||
|
|
|
|||
8
index.go
8
index.go
|
|
@ -265,12 +265,6 @@ var indexQueue = make(chan struct{}, 8)
|
|||
|
||||
// openFields opens and initializes the fields inside the index.
|
||||
func (i *Index) openFields(idx *disco.Index) error {
|
||||
f, err := os.Open(i.FieldsPath())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "opening fields directory")
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
eg, ctx := errgroup.WithContext(context.Background())
|
||||
var mu sync.Mutex
|
||||
|
||||
|
|
@ -308,7 +302,7 @@ fileLoop:
|
|||
}
|
||||
}
|
||||
|
||||
err = eg.Wait()
|
||||
err := eg.Wait()
|
||||
if err != nil {
|
||||
// Close any fields which got opened, since the overall
|
||||
// index won't be open.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue