fix: check if nginx is running before reloading during an app deletion

The purpose of the reload is to remove nginx from being loaded. If nginx isn't running, then by definition the config is not loaded.

Closes #6832
This commit is contained in:
Jose Diaz-Gonzalez
2024-09-23 21:21:33 -04:00
parent 0f8395365e
commit ac56a5ffdd
3 changed files with 59 additions and 6 deletions

View File

@@ -10,7 +10,9 @@ trigger-nginx-vhosts-post-delete() {
declare APP="$1"
fn-plugin-property-destroy "nginx" "$APP"
restart_nginx "$@" >/dev/null
if fn-nginx-vhosts-nginx-is-running; then
restart_nginx "$@" >/dev/null
fi
rm -rf "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP"
}