Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create file before put content to it #71

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/content.en/docs/release-notes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Information about release notes of INFINI Framework is provided here.
- Add new stats api to quickly find the top N keys from a Badger DB (#67)

### Bug fix
- Fix client sync config panic when config folder not exits (#71)

### Improvements
- Add util to http handler, support to parse bool parameter
- Handle simplified bulk metdata, parse index from url path (#59)
Expand Down
6 changes: 5 additions & 1 deletion modules/configs/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func SaveConfigStr(name, content string) error {
if err != nil {
return err
}

fileToSave := path.Join(cfgDir, name)

log.Info("write config file: ", fileToSave)
Expand All @@ -138,6 +137,11 @@ func SaveConfigStr(name, content string) error {
}
}

_, err = util.CreateFile(cfgDir, "")
if err != nil {
return err
}

_, err = util.FilePutContent(fileToSave, content)
if err != nil {
return err
Expand Down
Loading