diff --git a/src/sumo/wrapper/sumo_client.py b/src/sumo/wrapper/sumo_client.py index c8780a7..77272b5 100644 --- a/src/sumo/wrapper/sumo_client.py +++ b/src/sumo/wrapper/sumo_client.py @@ -26,6 +26,8 @@ "SUMOCONNECTIONINFO", "https://api.sumo.equinor.com/well-known" ) +well_known = None + class SumoClient: """Authenticate and perform requests to the Sumo API.""" @@ -70,8 +72,9 @@ def __init__( """ logger.setLevel(verbosity) - - well_known = httpx.get(WELL_KNOWN).json() + global well_known + if well_known is None: + well_known = httpx.get(WELL_KNOWN).json() if env not in well_known["envs"]: raise ValueError(f"Invalid environment: {env}")