From c1a6c14d6b01c30d610849861bf9404990de08fc Mon Sep 17 00:00:00 2001 From: Lu Weizheng Date: Tue, 13 Aug 2024 12:37:22 +0800 Subject: [PATCH] filter config --- python/xoscar/backends/communication/socket.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/xoscar/backends/communication/socket.py b/python/xoscar/backends/communication/socket.py index d80aeef..37ff103 100644 --- a/python/xoscar/backends/communication/socket.py +++ b/python/xoscar/backends/communication/socket.py @@ -203,14 +203,16 @@ def channel_type(self) -> int: @classmethod def parse_config(cls, config: dict) -> dict: - return config + # we only need the following config + keys_of_interest = ['listen_elastic_ip', 'address', 'host', 'port'] + parsed_config = {key: config[key] for key in keys_of_interest if key in config} + + return parsed_config @staticmethod @implements(Server.create) async def create(config: Dict) -> "Server": config = config.copy() - if "ucx" in config: - config.pop("ucx") if "address" in config: address = config.pop("address") host, port = address.rsplit(":", 1)