From a68d2e71d0037179f3cc181a833325117600ccaf Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 25 Dec 2021 16:44:16 -0500 Subject: [PATCH] feat: add ability to skip restarts when linking datastores This allows multiple datastores to be linked at a given time, thus decreasing provisioning times. --- common-functions | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common-functions b/common-functions index d84a267..513e741 100755 --- a/common-functions +++ b/common-functions @@ -533,7 +533,11 @@ service_link() { fi [[ -n "$SERVICE_QUERYSTRING" ]] && SERVICE_URL="${SERVICE_URL}?${SERVICE_QUERYSTRING}" plugn trigger service-action post-link "$SERVICE" "$APP" - config_set "$APP" "${ALIAS}_URL=$SERVICE_URL" + if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]]; then + config_set --no-restart "$APP" "${ALIAS}_URL=$SERVICE_URL" + else + config_set "$APP" "${ALIAS}_URL=$SERVICE_URL" + fi plugn trigger service-action post-link-complete "$SERVICE" "$APP" } @@ -857,7 +861,11 @@ service_unlink() { [[ -z ${LINK[*]} ]] && dokku_log_fail "Not linked to app $APP" plugn trigger service-action post-unlink "$SERVICE" "$APP" - config_unset "$APP" "${LINK[@]}" + if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]]; then + config_unset --no-restart "$APP" "${LINK[@]}" + else + config_unset "$APP" "${LINK[@]}" + fi plugn trigger service-action post-unlink-complete "$SERVICE" "$APP" }