Feature/112 api version (#119)

* Add api_version to status api and server_proxy.py

* Add api_version to Zeroconf and filter out incompatible versions when finding available servers

* Filter incompatible versions from the UI
This commit is contained in:
2025-02-28 19:39:32 -06:00
committed by GitHub
parent 6b68d42b93
commit 562cb23da3
5 changed files with 22 additions and 7 deletions

View File

@@ -374,13 +374,15 @@ class DistributedJobManager:
:param system_os: str, Restrict results to servers running a specific OS
:return: A list of dictionaries with each dict containing hostname and cpu_count of available servers
"""
from api.api_server import API_VERSION
available_servers = []
for hostname in ZeroconfServer.found_hostnames():
host_properties = ZeroconfServer.get_hostname_properties(hostname)
if not system_os or (system_os and system_os == host_properties.get('system_os')):
response = RenderServerProxy(hostname).is_engine_available(engine_name)
if response and response.get('available', False):
available_servers.append(response)
if host_properties.get('api_version') == API_VERSION:
if not system_os or (system_os and system_os == host_properties.get('system_os')):
response = RenderServerProxy(hostname).is_engine_available(engine_name)
if response and response.get('available', False):
available_servers.append(response)
return available_servers