[bugfix] fix duplicate api endpoints (#139)

* fix server api to serve

* remove print
This commit is contained in:
Xi Yan 2024-09-27 15:32:50 -07:00 committed by GitHub
parent 208b861289
commit 6236634d84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -433,18 +433,15 @@ def main(yaml_config: str, port: int = 5000, disable_ipv6: bool = False):
if config.apis_to_serve: if config.apis_to_serve:
apis_to_serve = set(config.apis_to_serve) apis_to_serve = set(config.apis_to_serve)
for inf in builtin_automatically_routed_apis():
if inf.router_api.value in apis_to_serve:
apis_to_serve.add(inf.routing_table_api)
else: else:
apis_to_serve = set(impls.keys()) apis_to_serve = set(impls.keys())
for api_str in apis_to_serve: for api_str in apis_to_serve:
api = Api(api_str) api = Api(api_str)
endpoints = all_endpoints[api] endpoints = all_endpoints[api]
impl = impls[api] impl = impls[api]
provider_spec = specs[api] provider_spec = specs[api]
if ( if (
isinstance(provider_spec, RemoteProviderSpec) isinstance(provider_spec, RemoteProviderSpec)