From 831fdeb030b452992b8f47832166231b83155d23 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 8 Jan 2017 20:17:23 -0700 Subject: [PATCH 1/3] fix: allow ps_start to fail during a ps:restore Instead of blocking the start of each app based on whether the previous app started, we simply log and continue. Closes #2463 --- plugins/ps/subcommands/restore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index 0b7b83729..fc609d2e5 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -11,7 +11,11 @@ ps_restore_cmd() { local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true) if [[ $DOKKU_APP_RESTORE != 0 ]]; then echo "Restoring app $app ..." - ps_start "$app" + if ps_start "$app"; then + continue + fi + + dokku_log_warn "dokku ps:restore ${app} failed" fi done } From 815c612261e51190a1f9d7587c8682d22582993c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 8 Jan 2017 20:49:14 -0700 Subject: [PATCH 2/3] feat: add support for using parallel to restore apps By using parallel, we take advantage of the fact that a server may have multiple cores, thus enabling restores to complete faster. Refs #2463 --- plugins/ps/subcommands/restore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index fc609d2e5..1dab28f4b 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -7,6 +7,12 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_restore_cmd() { declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line" local cmd="ps:restore" + + if which parallel > /dev/null 2>&1; then + dokku_apps | parallel dokku ps:start + return + fi + for app in $(dokku_apps); do local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true) if [[ $DOKKU_APP_RESTORE != 0 ]]; then From 06fa58ff47ca935459a90e8ef7e7f14356f18ad5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 13 Jan 2017 17:29:51 -0700 Subject: [PATCH 3/3] chore: remove extra space [ci skip] --- plugins/ps/subcommands/restore | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index 1dab28f4b..818c3d980 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -20,7 +20,6 @@ ps_restore_cmd() { if ps_start "$app"; then continue fi - dokku_log_warn "dokku ps:restore ${app} failed" fi done