mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-08 01:12:49 +01:00
fix (config): save config when disk is full
before this, if the user had a full disk, there wouldn't be any error reported back whenever editing something in the admin console as file.Close() would return nil .... The only way to go around it is to wait for the sync to be done.
This commit is contained in:
parent
8303ae54f0
commit
5e420cf5f3
1 changed files with 4 additions and 0 deletions
|
|
@ -108,5 +108,9 @@ func SaveConfig(v []byte) error {
|
|||
configStr = val
|
||||
}
|
||||
file.Write(PrettyPrint([]byte(configStr)))
|
||||
if err = file.Sync(); err != nil {
|
||||
file.Close()
|
||||
return err
|
||||
}
|
||||
return file.Close()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue