2022-10-25 20:50:25 +00:00
|
|
|
"""Wait for db to be ready."""
|
2022-10-18 11:09:03 +00:00
|
|
|
import time
|
2022-10-17 02:31:55 +00:00
|
|
|
|
2022-10-25 20:50:25 +00:00
|
|
|
from spiffworkflow_backend import create_app
|
|
|
|
from spiffworkflow_backend.helpers.db_helper import try_to_connect
|
2022-10-17 02:31:55 +00:00
|
|
|
|
2022-10-18 11:09:03 +00:00
|
|
|
|
2022-10-17 02:31:55 +00:00
|
|
|
def main() -> None:
|
|
|
|
"""Main."""
|
2022-10-25 20:50:25 +00:00
|
|
|
app = create_app()
|
2022-10-17 02:31:55 +00:00
|
|
|
start_time = time.time()
|
|
|
|
with app.app_context():
|
|
|
|
try_to_connect(start_time)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|