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
This commit is contained in:
Jose Diaz-Gonzalez
2017-01-08 20:49:14 -07:00
parent 831fdeb030
commit 815c612261

View File

@@ -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