from database import init_db
import time
import logging

# Not great but allows to wait until the db is ready to accept connections
while True:
    try:
        init_db()
        logging.info('DB is ready')
        break
    except Exception as e:
        logging.warning('DB not ready... waiting')
        time.sleep(1)

a3f6480cd6edca34c1a544182e127457c0172a9c
<mask token>

<mask token>
while True:
    try:
        init_db()
        logging.info('DB is ready')
        break
    except Exception as e:
        logging.warning('DB not ready... waiting')
        time.sleep(1)

from database import init_db
import time
import logging
while True:
    try:
        init_db()
        logging.info('DB is ready')
        break
    except Exception as e:
        logging.warning('DB not ready... waiting')
        time.sleep(1)

from database import init_db
import time
import logging

# Not great but allows to wait until the db is ready to accept connections
while True:
    try:
        init_db()
        logging.info('DB is ready')
        break
    except Exception as e:
        logging.warning('DB not ready... waiting')
        time.sleep(1)
