fix: use updated fn-ps-is-app-running function to determine an application's status

In some cases, a single allocation for a service may not be running, but the others will, and `is_app_running` will return the wrong thing.

Closes #2772
This commit is contained in:
Jose Diaz-Gonzalez
2018-04-28 01:21:26 -04:00
parent 8d07ffe775
commit 9b41f7a74e

View File

@@ -91,10 +91,17 @@ ps_start() {
declare desc="starts app"
local APP="$1"; verify_app_name "$APP"
local IMAGE_TAG=$(get_running_image_tag "$APP");
local RUNNING
if (is_deployed "$APP"); then
plugn trigger pre-start "$APP"
if ! (is_app_running "$APP"); then
RUNNING="$(fn-ps-is-app-running "$APP")"
if [[ "$RUNNING" == "mixed" ]]; then
dokku_log_warn "App is running in mixed mode, releasing"
fi
if [[ "$RUNNING" != "true" ]]; then
release_and_deploy "$APP" "$IMAGE_TAG"
else
dokku_log_warn "App $APP already running"