feat: use timeout for axios requests

This commit is contained in:
Dipin Jagadish 2023-10-15 18:26:17 +01:00
parent a2b6bc5970
commit ad3f1b2331
2 changed files with 15 additions and 0 deletions

View File

@ -205,6 +205,8 @@ const registerNetworkIpc = (mainWindow) => {
});
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
const httpsAgentRequestFields = {};
if (!sslVerification) {
@ -505,6 +507,8 @@ const registerNetworkIpc = (mainWindow) => {
const preparedRequest = prepareGqlIntrospectionRequest(endpoint, envVars, request, collectionRoot);
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
if (!sslVerification) {
@ -683,6 +687,8 @@ const registerNetworkIpc = (mainWindow) => {
});
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
// proxy configuration

View File

@ -5,6 +5,7 @@ class BrunoRequest {
this.method = req.method;
this.headers = req.headers;
this.body = req.data;
this.timeout = req.timeout;
}
getUrl() {
@ -50,6 +51,14 @@ class BrunoRequest {
setMaxRedirects(maxRedirects) {
this.req.maxRedirects = maxRedirects;
}
getTimeout() {
return this.req.timeout;
}
setTimeout(timeout) {
this.req.timeout = timeout;
}
}
module.exports = BrunoRequest;