mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Merge pull request #1525 from travisturner/startup-log-dir
[CORE-362] Create the data directory during "log startup" if it doesn't already exist
This commit is contained in:
commit
81c47b778e
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