mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
Simplify holder logOutput
This commit is contained in:
parent
d96a121347
commit
271dd5a63b
4 changed files with 6 additions and 8 deletions
|
|
@ -23,7 +23,6 @@ import (
|
|||
"io/ioutil"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
@ -191,7 +190,7 @@ func NewHolder() *Holder {
|
|||
// MustOpenHolder creates and opens a holder at a temporary path. Panic on error.
|
||||
func MustOpenHolder() *Holder {
|
||||
h := NewHolder()
|
||||
if err := h.Open(os.Stderr); err != nil {
|
||||
if err := h.Open(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return h
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ func NewHolder() *Holder {
|
|||
}
|
||||
|
||||
// Open initializes the root data directory for the holder.
|
||||
func (h *Holder) Open(logOutput io.Writer) error {
|
||||
func (h *Holder) Open() error {
|
||||
if err := os.MkdirAll(h.Path, 0777); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -87,8 +87,6 @@ func (h *Holder) Open(logOutput io.Writer) error {
|
|||
return err
|
||||
}
|
||||
|
||||
h.LogOutput = logOutput
|
||||
|
||||
for _, fi := range fis {
|
||||
if !fi.IsDir() {
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ func NewHolder() *Holder {
|
|||
// MustOpenHolder creates and opens a holder at a temporary path. Panic on error.
|
||||
func MustOpenHolder() *Holder {
|
||||
h := NewHolder()
|
||||
if err := h.Open(&h.LogOutput); err != nil {
|
||||
if err := h.Open(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return h
|
||||
|
|
@ -439,7 +439,7 @@ func (h *Holder) Reopen() error {
|
|||
h.Holder = pilosa.NewHolder()
|
||||
h.Holder.Path = path
|
||||
h.Holder.LogOutput = logOutput
|
||||
if err := h.Holder.Open(&h.LogOutput); err != nil {
|
||||
if err := h.Holder.Open(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ func (s *Server) Open() error {
|
|||
}
|
||||
|
||||
// Open holder.
|
||||
if err := s.Holder.Open(s.LogOutput); err != nil {
|
||||
s.Holder.LogOutput = s.LogOutput
|
||||
if err := s.Holder.Open(); err != nil {
|
||||
return fmt.Errorf("opening Holder: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue