Skip to content

Commit

Permalink
filter config
Browse files Browse the repository at this point in the history
  • Loading branch information
luweizheng committed Aug 13, 2024
1 parent 3dd0802 commit c1a6c14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/xoscar/backends/communication/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1a6c14

Please sign in to comment.