diff --git a/plugins/common/common.go b/plugins/common/common.go index 6d9c5ae5a..78e938f84 100644 --- a/plugins/common/common.go +++ b/plugins/common/common.go @@ -74,13 +74,10 @@ func GetAppScheduler(appName string) string { wg.Add(1) go func() { defer wg.Done() - b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...) - value := strings.TrimSpace(string(b[:])) - if value != "" { - appScheduler = value - } + appScheduler = getAppScheduler(appName) }() } + wg.Add(1) go func() { defer wg.Done() @@ -95,6 +92,15 @@ func GetAppScheduler(appName string) string { return appScheduler } +func getAppScheduler(appName string) string { + b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...) + value := strings.TrimSpace(string(b[:])) + if value != "" { + return value + } + return "" +} + // GetGlobalScheduler fetchs the global scheduler func GetGlobalScheduler() string { b, _ := PlugnTriggerOutput("config-get-global", []string{"DOKKU_SCHEDULER"}...)