mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Pass logOutput to Holder.Open
This commit is contained in:
parent
b9e853dbdb
commit
855f224778
2 changed files with 4 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ func NewHolder() *Holder {
|
|||
}
|
||||
|
||||
// Open initializes the root data directory for the holder.
|
||||
func (h *Holder) Open() error {
|
||||
func (h *Holder) Open(logOutput io.Writer) error {
|
||||
if err := os.MkdirAll(h.Path, 0777); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -87,6 +87,8 @@ func (h *Holder) Open() error {
|
|||
return err
|
||||
}
|
||||
|
||||
h.LogOutput = logOutput
|
||||
|
||||
for _, fi := range fis {
|
||||
if !fi.IsDir() {
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ func (s *Server) Open() error {
|
|||
}
|
||||
|
||||
// Open holder.
|
||||
if err := s.Holder.Open(); err != nil {
|
||||
if err := s.Holder.Open(s.LogOutput); err != nil {
|
||||
return fmt.Errorf("opening Holder: %v", err)
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +159,6 @@ func (s *Server) Open() error {
|
|||
|
||||
// Initialize Holder.
|
||||
s.Holder.Broadcaster = s.Broadcaster
|
||||
s.Holder.LogOutput = s.LogOutput
|
||||
|
||||
// Serve HTTP.
|
||||
go func() { http.Serve(ln, s.Handler) }()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue