Skip to content

Commit

Permalink
fix(api): Remove timeout and set retry limit to 300
Browse files Browse the repository at this point in the history
This way, the client retry to get result until 10minutes
  • Loading branch information
vvatelot committed Sep 10, 2024
1 parent f649d83 commit c835cbb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assets/js/services/ApiService.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -36,7 +36,7 @@ class ApiService {
const options = {
method: "get",
retry: {
limit: 30,
limit: 300,
statusCodes: [425],
backoffLimit: 2000,
},
Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit c835cbb

Please sign in to comment.