# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
from polaris.utils.db_config import DbConfig


def is_cluster_accessible():
    try:
        engine = DbConfig.eqsql_db().create_engine()
        engine.dispose()
        return True
    except Exception as e:
        print("Could not connect to EQSQL server. The cluster folder has been disabled.")
        print(e.args)
        return False
