2023-12-05 16:41:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function error_handler() {
|
2024-03-06 21:43:06 +00:00
|
|
|
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
|
2023-12-05 16:41:59 +00:00
|
|
|
exit "$2"
|
|
|
|
}
|
|
|
|
trap 'error_handler ${LINENO} $?' ERR
|
|
|
|
set -o errtrace -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
export SPIFFWORKFLOW_BACKEND_CELERY_ENABLED=true
|
|
|
|
export SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER_IN_CREATE_APP=false
|
|
|
|
|
2024-03-06 21:43:06 +00:00
|
|
|
# so we can raise if calling unsafe code in celery
|
|
|
|
export SPIFFWORKFLOW_BACKEND_RUNNING_IN_CELERY_WORKER=true
|
|
|
|
|
2024-06-13 17:34:32 +00:00
|
|
|
script_dir="$(
|
|
|
|
cd -- "$(dirname "$0")" >/dev/null 2>&1
|
|
|
|
pwd -P
|
|
|
|
)"
|
|
|
|
"${script_dir}/wait_for_db_schema_migrations"
|
|
|
|
exec poetry run celery -A src.spiffworkflow_backend.background_processing.celery_worker worker --loglevel=info
|