feat: add better logging to ps:restore output

Without the logging additions, it's a bit more difficult to figure out why a ps:restore is skipping the restore of an app.
This commit is contained in:
Jose Diaz-Gonzalez
2020-12-19 18:19:07 -05:00
parent 89d6f0eb6e
commit 3ba775d4b3

View File

@@ -99,6 +99,7 @@ func Restore(appName string) error {
return fmt.Errorf("Error running pre-restore: %s", err)
}
common.LogInfo1("Clearing potentially invalid proxy configuration")
if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil {
return fmt.Errorf("Error clearing proxy config: %s", err)
}
@@ -111,9 +112,11 @@ func Restore(appName string) error {
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_RESTORE"}...)
restore := strings.TrimSpace(string(b[:]))
if restore == "0" {
common.LogWarn(fmt.Sprintf("Skipping ps:restore for %s as DOKKU_APP_RESTORE=%s", appName, restore))
return nil
}
common.LogInfo1("Starting app")
return Start(appName)
}