Skip to content

Comments

feat: do not use open servers unless explicitly specified#96

Open
Yan-Muzi wants to merge 2 commits intomainfrom
server-list
Open

feat: do not use open servers unless explicitly specified#96
Yan-Muzi wants to merge 2 commits intomainfrom
server-list

Conversation

@Yan-Muzi
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modifies the server selection logic to exclude "open" servers by default, filtering to only use servers that start with "node" unless explicitly specified via the server_list parameter. This change is motivated by performance concerns, as noted in the comment that open servers are too slow.

Changes:

  • Modified server selection logic to filter out "open" servers by default when server_list is "all" or empty
  • Added explanatory comment about why open servers are excluded
  • Applied filtering using lambda function to check server names starting with "node"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 162 to 164
serer_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL))
desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(serer_pool))
server_pool = random.sample(serer_pool, k=desired_sever_num)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in variable name: 'serer_pool' should be 'server_pool'. The word 'server' is misspelled as 'serer'. Although the code is internally consistent (using 'serer_pool' on lines 162-164), this typo makes the code harder to read and maintain.

Suggested change
serer_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL))
desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(serer_pool))
server_pool = random.sample(serer_pool, k=desired_sever_num)
server_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL))
desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(server_pool))
server_pool = random.sample(server_pool, k=desired_sever_num)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant