From ee1a5e8ea426d858ee95e1b42ad28fdadcbb66a1 Mon Sep 17 00:00:00 2001 From: Vincent Vatelot Date: Tue, 10 Sep 2024 12:20:39 +0200 Subject: [PATCH] fix(api): Remove timeout and set retry limit to 300 (#377) This way, the client retry to get result until 10 minutes --- assets/js/services/ApiService.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/services/ApiService.js b/assets/js/services/ApiService.js index dcb6dd2b..a44de60f 100644 --- a/assets/js/services/ApiService.js +++ b/assets/js/services/ApiService.js @@ -1,7 +1,7 @@ import ky from "ky"; -const BASE_URL = "https://api.ecoindex.fr/v1/" -const BROWSER_WIDTH = 1920 +const BASE_URL = "https://api.ecoindex.fr/v1/"; +const BROWSER_WIDTH = 1920; const BROWSER_HEIGHT = 1080; class ApiService { @@ -36,7 +36,7 @@ class ApiService { const options = { method: "get", retry: { - limit: 30, + limit: 300, statusCodes: [425], backoffLimit: 2000, }, @@ -99,13 +99,13 @@ class ApiService { return ky(slug, { ...options, prefixUrl: BASE_URL, - timeout: 60000, // 60s instead of 10s default + timeout: false, // Set to no timeout signal, headers: { "content-type": "application/json", }, redirect: "follow", - }).json() + }).json(); } }