auto-sync: 2026-05-06 19:00:01
This commit is contained in:
@@ -913,7 +913,7 @@ async def _build_segmented_route(req: RouteRequest) -> dict:
|
||||
except Exception as e:
|
||||
raise HTTPException(503, f"OSRM недоступен: {e}")
|
||||
|
||||
# Retry TooBig → 3 → 1
|
||||
# Retry TooBig → 3 → 2 → 1
|
||||
if data.get("code") == "TooBig":
|
||||
url2 = url.replace("alternatives=5", "alternatives=3")
|
||||
try:
|
||||
@@ -922,6 +922,14 @@ async def _build_segmented_route(req: RouteRequest) -> dict:
|
||||
data = resp.json()
|
||||
except Exception as e:
|
||||
raise HTTPException(503, f"OSRM недоступен: {e}")
|
||||
if data.get("code") == "TooBig":
|
||||
url2b = url.replace("alternatives=5", "alternatives=2")
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=60) as client:
|
||||
resp = await client.get(url2b)
|
||||
data = resp.json()
|
||||
except Exception as e:
|
||||
raise HTTPException(503, f"OSRM недоступен: {e}")
|
||||
if data.get("code") == "TooBig":
|
||||
url1 = url.replace("alternatives=5", "alternatives=false")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user