Skip to content

Commit

Permalink
improve axios keep_a_live
Browse files Browse the repository at this point in the history
  • Loading branch information
HGlab01 authored Sep 22, 2023
1 parent 0a4f869 commit 0309f1c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ const isOnline = require('@esm2cjs/is-online').default;
const https = require('https');
const axios = require('axios');
// @ts-ignore
let axiosInstance = axios.create({});
let axiosInstance = axios.create({
timeout: 20000,
baseURL: `${tado_url}/`,
httpsAgent: new https.Agent({ keepAlive: true }),
});

const oneHour = 60 * 60 * 1000;
let polling; // Polling timer
Expand Down Expand Up @@ -1161,9 +1165,7 @@ class Tado extends utils.Adapter {
this.refreshToken().then(() => {

axiosInstance({
timeout: 20000,
httpsAgent: new https.Agent({ keepAlive: true }),
url: tado_url + url,
url: url,
method: method,
data: data,
headers: {
Expand Down

0 comments on commit 0309f1c

Please sign in to comment.