mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-23 05:25:35 +03:00
Fix race condition of trying to write YAML config simultaneously and failing.
This commit is contained in:
parent
942cde79bd
commit
2012e707d0
1 changed files with 2 additions and 0 deletions
|
@ -172,6 +172,8 @@ func parseConfig() error {
|
||||||
|
|
||||||
// Saves configuration to the YAML file and also saves the user filter contents to a file
|
// Saves configuration to the YAML file and also saves the user filter contents to a file
|
||||||
func writeConfig() error {
|
func writeConfig() error {
|
||||||
|
c.Lock()
|
||||||
|
defer c.Unlock()
|
||||||
configFile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename)
|
configFile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename)
|
||||||
log.Printf("Writing YAML file: %s", configFile)
|
log.Printf("Writing YAML file: %s", configFile)
|
||||||
yamlText, err := yaml.Marshal(&config)
|
yamlText, err := yaml.Marshal(&config)
|
||||||
|
|
Loading…
Reference in a new issue