fix pyworker miscounting active connections (#20)

* fix pyworker miscounting active connections

* clean up some issues

* add option to skip auth
This commit is contained in:
Nader Arbabian
2025-07-15 15:33:27 -07:00
committed by GitHub
parent 0bf2d04223
commit 6fb610cb5b
7 changed files with 59 additions and 43 deletions
+6 -2
View File
@@ -17,7 +17,9 @@ class Endpoint:
"""
@staticmethod
def get_endpoint_api_key(endpoint_name: str, account_api_key: str) -> Optional[str]:
def get_endpoint_api_key(
endpoint_name: str, account_api_key: str, instance: str
) -> Optional[str]:
"""
Fetch endpoint API key from VastAI console following the healthcheck pattern.
@@ -33,7 +35,9 @@ class Endpoint:
try:
log.debug(f"Fetching endpoint API key for endpoint: {endpoint_name}")
response = requests.get(vast_console_url, headers=headers)
response = requests.get(
f"{vast_console_url}?autoscaler_instance={instance}", headers=headers
)
if response.status_code != 200:
error_msg = f"Failed to fetch endpoint API key: {response.status_code} - {response.text}"