예제 #1
0
def log_database_connection_status() -> None:
    if check_database_connection():
        logger.info("Worker: database connection OK")
    else:
        logger.critical("Worker: database connection KO")
    db.session.remove()
    db.session.close()
    db.engine.dispose()
예제 #2
0
def health_database():
    database_working = check_database_connection()
    return_code = 200 if database_working else 500
    output = read_version_from_file()
    return output, return_code
예제 #3
0
def log_database_connection_status():
    with app.app_context():
        if check_database_connection():
            logger.info("Worker: database connection OK")
        else:
            logger.critical("Worker: database connection KO")