mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-28 04:05:21 +08: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:
@ -108,5 +108,9 @@ func SaveConfig(v []byte) error {
|
|||||||
configStr = val
|
configStr = val
|
||||||
}
|
}
|
||||||
file.Write(PrettyPrint([]byte(configStr)))
|
file.Write(PrettyPrint([]byte(configStr)))
|
||||||
|
if err = file.Sync(); err != nil {
|
||||||
|
file.Close()
|
||||||
|
return err
|
||||||
|
}
|
||||||
return file.Close()
|
return file.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user