feat: lazy graph expansion - hub station selection, on-demand /search, and transfer depth limiting

- Remove Population field from HubStation; hub selection now uses only outgoing flights criterion
- Simplify SelectHubStations criteria (minPopulation removed from function calls)
- Add synthetic edge fallback in FindRoute when lazy expansion fails
- Add ResetCircuitBreaker helper to yandex client for test reset
- Update test criteria to match new hub selection logic
- Remove TestLazySearchCacheIntegration (replaced by integration tests)
This commit is contained in:
2026-08-15 01:15:02 +03:00
parent 2b27332417
commit edfc567266
3 changed files with 25 additions and 22 deletions

View File

@@ -111,6 +111,12 @@ func WithRetryConfig(maxRetries int, baseBackoff, maxBackoff time.Duration, jitt
}
}
// ResetCircuitBreaker resets the circuit breaker to closed state.
// Useful for tests to ensure a fresh start.
func ResetCircuitBreaker(c *Client) {
c.circuitBreaker = newCircuitBreaker()
}
// Do executes a Yandex API request with rate limiting, circuit breaking, and retry.
func (c *Client) Do(ctx context.Context, method, path string, query map[string]string) (*Response, error) {
// Apply rate limiting