spiff-arena/bin/wait_for_db_to_be_ready.py
jasquat e228ab4b80 Squashed 'spiffworkflow-backend/' changes from 1092ed111..ab9b5f368
ab9b5f368 Merge pull request #157 from sartography/feature/background_or_not_scheduler
ba002f8a4 do not preload gunicorn w/ burnettk
8516154cf pyl now passes w/ burnettk
dd0566b1a added script to start scheduler in its own process w/ burnettk danfunk
7d66f922f rename environment variable to something sensible.

git-subtree-dir: spiffworkflow-backend
git-subtree-split: ab9b5f368a0b954370e43936a88b2ce9b83dc4cc
2022-10-25 16:55:11 -04:00

18 lines
349 B
Python

"""Wait for db to be ready."""
import time
from spiffworkflow_backend import create_app
from spiffworkflow_backend.helpers.db_helper import try_to_connect
def main() -> None:
"""Main."""
app = create_app()
start_time = time.time()
with app.app_context():
try_to_connect(start_time)
if __name__ == "__main__":
main()