diff --git a/services/mana-geocoding/CLAUDE.md b/services/mana-geocoding/CLAUDE.md index cfdde7217..c3831fd96 100644 --- a/services/mana-geocoding/CLAUDE.md +++ b/services/mana-geocoding/CLAUDE.md @@ -154,7 +154,7 @@ PORT=3018 # --- Provider chain (tried in order) ---------------------------------- GEOCODING_PROVIDERS=pelias,photon,nominatim -PROVIDER_TIMEOUT_MS=5000 # per-provider request timeout +PROVIDER_TIMEOUT_MS=8000 # per-provider request timeout (cold-start safe) PROVIDER_HEALTH_CACHE_MS=30000 # health-cache TTL — skip dead providers # --- Pelias (primary) ------------------------------------------------- diff --git a/services/mana-geocoding/src/config.ts b/services/mana-geocoding/src/config.ts index 04bb88bd7..96f2c8888 100644 --- a/services/mana-geocoding/src/config.ts +++ b/services/mana-geocoding/src/config.ts @@ -72,7 +72,11 @@ export function loadConfig(): Config { 'nominatim', ]), healthCacheMs: parseInt(process.env.PROVIDER_HEALTH_CACHE_MS || '30000', 10), - timeoutMs: parseInt(process.env.PROVIDER_TIMEOUT_MS || '5000', 10), + // 8 s default. Nominatim's cold-start DNS+TLS handshake can push the + // first health probe past the older 5 s default, false-marking the + // provider unhealthy for the next 30 s. 8 s survives a slow first + // probe but still cuts off actually-stuck connections. + timeoutMs: parseInt(process.env.PROVIDER_TIMEOUT_MS || '8000', 10), }, }; }