Browse Source

Correctly show update errors in web ui (#1157)

specter-1.7.2
Luke Childs 3 years ago
committed by GitHub
parent
commit
e5d24d28b8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      scripts/update/01-run.sh
  2. 10
      scripts/update/update

1
scripts/update/01-run.sh

@ -141,6 +141,7 @@ EOF
# If this doesn't resolve the issue, start containers again before failing so the web UI is still accessible
echo "That didn't work, attempting to restart containers"
./scripts/start
echo "Error stopping Docker containers" > "${UMBREL_ROOT}/statuses/update-failure"
false
}
}

10
scripts/update/update

@ -139,6 +139,16 @@ rm -f "$UMBREL_ROOT"/statuses/update-in-progress
update_state=$(cat "${UMBREL_ROOT}/statuses/update-status.json" | jq .state -r)
# Show error
update_failure_status_file="${UMBREL_ROOT}/statuses/update-failure"
if [[ -f "${update_failure_status_file}" ]]; then
reason=$(cat "${update_failure_status_file}")
rm "${update_failure_status_file}"
cat <<EOF > "${UMBREL_ROOT}/statuses/update-status.json"
{"state": "failed", "progress": 100, "description": "${reason}", "updateTo": ""}
EOF
fi
if [[ "${update_state}" != "success" ]] && [[ "${update_state}" != "failed" ]]; then
# Sleep for a few seconds to make sure the user is on the update view
sleep 8

Loading…
Cancel
Save