mirror of
https://github.com/safing/portbase
synced 2025-04-09 03:59:08 +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
|
||||
}
|
||||
|
||||
// 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
|
||||
// lock and must lock each option!
|
||||
func saveConfig() error {
|
||||
func SaveConfig() error {
|
||||
optionsLock.RLock()
|
||||
defer optionsLock.RUnlock()
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ func setConfigOption(key string, value any, push bool) (err error) {
|
|||
// finalize change, activate triggers
|
||||
signalChanges()
|
||||
|
||||
return saveConfig()
|
||||
return SaveConfig()
|
||||
}
|
||||
|
||||
// SetDefaultConfigOption sets a single value in the (fallback) default config.
|
||||
|
|
Loading…
Add table
Reference in a new issue