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()
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
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")