import time


def wait_for_influxdb(db_client):
    """Function to wait for the influxdb service to be available."""
    try:
        db_client.ping()
        print("connected to db")
        return None
    except ConnectionError:
        print("not yet")
        time.sleep(1)
        wait_for_influxdb(db_client)