Skip to content

Commit

Permalink
Bugfix: ETL Lock Depends on Migration (#134)
Browse files Browse the repository at this point in the history
Added method to check if the migration container has completed before checking the ETL status
  • Loading branch information
Michael-Burke authored May 17, 2024
1 parent 07756e6 commit 5a61bee
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/_manage_postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ function mod_autofix() {
}

function mod_check_etl_status() {
local migration_exited="running"
title "Checking Data Migration Status"
info "Checking Migration Status"
if [ "$CONTAINER_RUNTIME" == "podman" ]; then
local migration_exited=$(podman container inspect --format '{{.State.Status}}' "migrations")
else
local migration_exited=$(docker inspect --format '{{.State.Status}}' "plextrac-couchbase-migrations-1")
fi
while [ "$migration_exited" == "running" ]; do
# Check if the migration container has exited, e.g., migrations have completed or failed
if [ "$CONTAINER_RUNTIME" == "podman" ]; then
local migration_exited=$(podman container inspect --format '{{.State.Status}}' "migrations")
else
local migration_exited=$(docker inspect --format '{{.State.Status}}' "plextrac-couchbase-migrations-1")
fi
for s in / - \\ \|; do printf "\r$s"; sleep .1; done
done
printf "\r"
info "Migrations complete"

title "Checking Data ETL Status"
debug "Checking ETL health and status..."
ETL_OUTPUT=${ETL_OUTPUT:-true}
Expand Down

0 comments on commit 5a61bee

Please sign in to comment.