config: fsync the config file after writing #3411

This should help with data integrity
This commit is contained in:
Nick Craig-Wood 2020-03-16 18:20:16 +00:00
parent 1e9b8e043a
commit 47e2d5c415
1 changed files with 1 additions and 0 deletions

View File

@ -558,6 +558,7 @@ func saveConfig() error {
_ = enc.Close()
}
_ = f.Sync()
err = f.Close()
if err != nil {
return errors.Errorf("Failed to close config file: %v", err)