commit dc8e9469e3d372882b972797491104079603c2a7
parent b5f886f686b8fae03056e01409c67b6ef64cb4e2
Author: Daisuke Akatsuka <daisuke@birchill.co.jp>
Date: Wed, 29 Oct 2025 22:40:37 +0000
Bug 1996199: Make Merino timeout period for fetching geolocation longer r=adw
Differential Revision: https://phabricator.services.mozilla.com/D270446
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/browser/components/urlbar/private/GeolocationUtils.sys.mjs b/browser/components/urlbar/private/GeolocationUtils.sys.mjs
@@ -20,6 +20,9 @@ const GEOLOCATION_CACHE_PERIOD_MS = 2 * 60 * 60 * 1000; // 2 hours.
// The mean Earth radius used in distance calculations.
const EARTH_RADIUS_KM = 6371.009;
+// Timeout setting to fetch geolocation from Merino.
+const MERINO_TIMEOUT_MS = 5000;
+
/**
* Utils for fetching the client's geolocation from Merino, computing distances
* between locations, and finding suggestions that best match the geolocation.
@@ -64,6 +67,7 @@ class _GeolocationUtils {
let results = await this.#merino.fetch({
providers: ["geolocation"],
query: "",
+ timeoutMs: MERINO_TIMEOUT_MS,
});
lazy.logger.debug("Got geolocation from Merino", results);