Merge pull request #5299 from dokku/5289-no-global-restarts

Do not trigger restarts when mutating config globally
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2022-08-11 15:50:17 -04:00
commit e15f411939
1 file changed
+3 -3
+3 -3
View File
@@ -31,7 +31,7 @@ func GetWithDefault(appName string, key string, defaultValue string) (value stri
//SetMany variables in the environment. If appName is empty the global config is used. If restart is true the app is restarted. //SetMany variables in the environment. If appName is empty the global config is used. If restart is true the app is restarted.
func SetMany(appName string, entries map[string]string, restart bool) (err error) { func SetMany(appName string, entries map[string]string, restart bool) (err error) {
global := appName == "" global := appName == "" || appName == "--global"
env, err := loadAppOrGlobalEnv(appName) env, err := loadAppOrGlobalEnv(appName)
if err != nil { if err != nil {
return return
@@ -63,7 +63,7 @@ func SetMany(appName string, entries map[string]string, restart bool) (err error
//UnsetMany a value in a config. If appName is empty the global config is used. If restart is true the app is restarted. //UnsetMany a value in a config. If appName is empty the global config is used. If restart is true the app is restarted.
func UnsetMany(appName string, keys []string, restart bool) (err error) { func UnsetMany(appName string, keys []string, restart bool) (err error) {
global := appName == "" global := appName == "" || appName == "--global"
env, err := loadAppOrGlobalEnv(appName) env, err := loadAppOrGlobalEnv(appName)
if err != nil { if err != nil {
return return
@@ -96,7 +96,7 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
//UnsetAll removes all config keys //UnsetAll removes all config keys
func UnsetAll(appName string, restart bool) (err error) { func UnsetAll(appName string, restart bool) (err error) {
global := appName == "" global := appName == "" || appName == "--global"
env, err := loadAppOrGlobalEnv(appName) env, err := loadAppOrGlobalEnv(appName)
if err != nil { if err != nil {
return return