Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): Remove timeout and set retry limit to 300 #377

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading