Fix for servers being returned that are less performant than the closest#23
Open
tystuyfzand wants to merge 3 commits intoarmbian:masterfrom
Open
Fix for servers being returned that are less performant than the closest#23tystuyfzand wants to merge 3 commits intoarmbian:masterfrom
tystuyfzand wants to merge 3 commits intoarmbian:masterfrom
Conversation
- Provides better documentation on the topChoices field - Changes default to only return the best server instead of top 3 - Avoids distant servers (>50km by default) from the top choice when topChoices is enabled, while still keeping similar servers (same location, etc) - Reverts localized servers due to issues with large countries and limited server selection
- Prepare code for unit tests - Mock unit tests in ideal cases
- Changes geolocation to a provider for use of either API or Mocking - Add server tests for testing closest/choices - Adds test for deviation checking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR rewrites the
Closestfunction to add aMaxDeviationfield, which allows a configurable maximum distance from the closest server to be used. This will prevent issues when there's a close (<50km) server, and then the next two closest are 500km away.Changes
maxDeviationin yaml) which defaults to 50kmlocalServerchecks which could cause issues with countries that only have one server, or servers that are nowhere near the user. For example, if a server is in Vancouver, BC in Canada, and a user from Toronto wants to get a mirror, it would prefer and return the Vancouver mirror instead of a closer Chicago or New York one. This is resolved by using one server and the MaxDeviation fields.