diff --git a/spiffworkflow-backend/bin/start_blocking_apscheduler b/spiffworkflow-backend/bin/start_blocking_apscheduler index 2fefb206a..711dfdcff 100755 --- a/spiffworkflow-backend/bin/start_blocking_apscheduler +++ b/spiffworkflow-backend/bin/start_blocking_apscheduler @@ -12,4 +12,4 @@ script_dir="$( pwd -P )" "${script_dir}/wait_for_db_schema_migrations" -exec poetry run ./bin/start_blocking_appscheduler.py +exec poetry run ./bin/start_blocking_apscheduler.py diff --git a/spiffworkflow-backend/bin/start_blocking_apscheduler.py b/spiffworkflow-backend/bin/start_blocking_apscheduler.py new file mode 100755 index 000000000..414b2aabf --- /dev/null +++ b/spiffworkflow-backend/bin/start_blocking_apscheduler.py @@ -0,0 +1,23 @@ +"""Start the appscheduler in blocking mode.""" + +import time + +from apscheduler.schedulers.background import BlockingScheduler # type: ignore +from spiffworkflow_backend import create_app +from spiffworkflow_backend.background_processing.apscheduler import start_apscheduler + + +def main() -> None: + # TODO: in 30 days remove this sleep when the new bash wrapper script is on prod envs + seconds_to_wait = 100 + print(f"sleeping for {seconds_to_wait} seconds to give the api container time to run the migration") + time.sleep(seconds_to_wait) + print("done sleeping") + #### + + app = create_app() + start_apscheduler(app, BlockingScheduler) + + +if __name__ == "__main__": + main()