mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
375ae53566
- Extract throttleNominatim() so reverseGeocodeCountry and reverseGeocodeRegion share the same lastNominatimCall state. Concurrent /stats + /regions no longer interleave requests faster than 1 req/s, closing the remaining 429 path from #576. - getVisitedRegions now returns cached data immediately and fills uncached places in a fire-and-forget background loop. Eliminates the N×1.1s response time that caused 504s behind reverse proxies (likely root cause of #493). geocodingInFlight set prevents double-enqueuing on concurrent page loads. - Add AbortSignal.timeout(10_000) to both Nominatim fetch calls so a hung upstream no longer stalls the endpoint indefinitely. - Unify User-Agent header in reverseGeocodeRegion to match policy.