mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 03:17:50 +00:00
Create the data directory during "log startup" if it doesn't already exist.
Prior to using etcd for node membership, the data director was created during the cluster topology setup. Since that no longer exists, we weren't actually creating the data directory before getting to logStartup(). So this change ensure that the data directory exists.
This commit is contained in:
parent
9b913ce904
commit
9e0ea9709a
1 changed files with 4 additions and 0 deletions
|
|
@ -1478,6 +1478,10 @@ func (h *Holder) logStartup() error {
|
|||
time := time.Now().Format(RFC3339NanoFixedWidth)
|
||||
logLine := fmt.Sprintf("%s\t%s\n", time, Version)
|
||||
|
||||
if err := os.MkdirAll(h.path, 0777); err != nil {
|
||||
return errors.Wrap(err, "creating data directory")
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(h.path+"/startup.log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "opening startup log")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue