mirror of
https://github.com/safing/portbase
synced 2025-04-21 09:49:10 +00:00
Expose SaveConfig for writing config to disk
This commit is contained in:
parent
0607924762
commit
7631b9d28a
2 changed files with 3 additions and 3 deletions
config
|
@ -58,10 +58,10 @@ func loadConfig(requireValidConfig bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// saveConfig saves the current configuration to file.
|
// SaveConfig saves the current configuration to file.
|
||||||
// It will acquire a read-lock on the global options registry
|
// It will acquire a read-lock on the global options registry
|
||||||
// lock and must lock each option!
|
// lock and must lock each option!
|
||||||
func saveConfig() error {
|
func SaveConfig() error {
|
||||||
optionsLock.RLock()
|
optionsLock.RLock()
|
||||||
defer optionsLock.RUnlock()
|
defer optionsLock.RUnlock()
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ func setConfigOption(key string, value any, push bool) (err error) {
|
||||||
// finalize change, activate triggers
|
// finalize change, activate triggers
|
||||||
signalChanges()
|
signalChanges()
|
||||||
|
|
||||||
return saveConfig()
|
return SaveConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDefaultConfigOption sets a single value in the (fallback) default config.
|
// SetDefaultConfigOption sets a single value in the (fallback) default config.
|
||||||
|
|
Loading…
Add table
Reference in a new issue