-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* explicitly wait for db migrations to be completed instead of sleeping w/ burnettk * code rabbit suggestion w/ burnettk * get rid of the set x w/ burnettk --------- Co-authored-by: jasquat <[email protected]>
- Loading branch information
Showing
8 changed files
with
63 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
function error_handler() { | ||
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." | ||
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." | ||
exit "$2" | ||
} | ||
trap 'error_handler ${LINENO} $?' ERR | ||
set -o errtrace -o errexit -o nounset -o pipefail | ||
|
||
script="$1" | ||
shift | ||
script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
script_dir="$( | ||
cd -- "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)" | ||
. "${script_dir}/local_development_environment_setup" | ||
|
||
export SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER_IN_CREATE_APP=false | ||
|
||
poet run python "$script" "$@" | ||
exec poet run python "$script" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
function error_handler() { | ||
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." | ||
exit "$2" | ||
} | ||
trap 'error_handler ${LINENO} $?' ERR | ||
set -o errtrace -o errexit -o nounset -o pipefail | ||
|
||
script_dir="$( | ||
cd -- "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)" | ||
"${script_dir}/wait_for_db_schema_migrations" | ||
exec poetry run ./bin/start_blocking_appscheduler.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
function error_handler() { | ||
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." | ||
exit "$2" | ||
} | ||
trap 'error_handler ${LINENO} $?' ERR | ||
set -o errtrace -o errexit -o nounset -o pipefail | ||
|
||
current_db_migration_revision=$(poetry run flask db current | awk '{print $1}') | ||
current_db_migration_head=$(poetry run flask db heads | awk '{print $1}') | ||
if [[ "$current_db_migration_revision" != "$current_db_migration_head" ]]; then | ||
echo "Waiting for db migrations to finish" | ||
echo "current revision: ${current_db_migration_head}" | ||
echo "head revision: ${current_db_migration_revision}" | ||
sleep 2 | ||
wait_for_db_migrations | ||
fi |