Skip to content

Commit 04a3f15

Browse files
committed
1 sec timeout instead of 5
1 parent 9a93d40 commit 04a3f15

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

backend/src/routes/deluge.route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ delugeRoute.get('/stats', async (req: Request, res: Response) => {
276276
headers: {
277277
'Content-Type': 'application/json'
278278
},
279-
timeout: 5000 // 5 second timeout for connection
279+
timeout: 1000
280280
});
281281

282282
// Store the cookie for future requests
@@ -340,7 +340,7 @@ delugeRoute.get('/stats', async (req: Request, res: Response) => {
340340
},
341341
{
342342
headers: { Cookie: cookie },
343-
timeout: 5000 // 5 second timeout
343+
timeout: 1000
344344
});
345345

346346
// Get session totals data (total upload/download)

backend/src/routes/pihole-v6.route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async function authenticatePihole(baseUrl: string, password: string): Promise<{
136136
headers: {
137137
'Content-Type': 'application/json'
138138
},
139-
timeout: 5000
139+
timeout: 1000
140140
}
141141
);
142142

@@ -235,7 +235,7 @@ async function handleApiWith401Retry(
235235
const config = {
236236
params: { sid: authInfo.sid },
237237
headers: { 'X-FTL-CSRF': authInfo.csrf, 'Content-Type': 'application/json' },
238-
timeout: 5000
238+
timeout: 1000
239239
};
240240

241241
// Make the API request based on the method
@@ -856,7 +856,7 @@ async function logoutPiholeSession(baseUrl: string, sid: string, csrf: string):
856856
'X-FTL-CSRF': csrf,
857857
'Content-Type': 'application/json'
858858
},
859-
timeout: 5000
859+
timeout: 1000
860860
});
861861

862862
console.log(`Successfully logged out Pi-hole session from ${baseUrl}`);

backend/src/routes/qbittorrent.route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ qbittorrentRoute.get('/stats', async (req: Request, res: Response) => {
238238
try {
239239
const transferInfo = await axios.get(`${baseUrl}/transfer/info`, {
240240
headers: { Cookie: cookie },
241-
timeout: 5000 // 5 second timeout
241+
timeout: 1000
242242
});
243243

244244
const torrentsMaindata = await axios.get(`${baseUrl}/torrents/info`, {
245245
headers: { Cookie: cookie },
246-
timeout: 5000 // 5 second timeout
246+
timeout: 1000
247247
});
248248

249249
// Count torrents by state
@@ -294,12 +294,12 @@ qbittorrentRoute.get('/stats', async (req: Request, res: Response) => {
294294
try {
295295
const transferInfo = await axios.get(`${baseUrl}/transfer/info`, {
296296
headers: { Cookie: newCookie },
297-
timeout: 5000 // 5 second timeout
297+
timeout: 1000
298298
});
299299

300300
const torrentsMaindata = await axios.get(`${baseUrl}/torrents/info`, {
301301
headers: { Cookie: newCookie },
302-
timeout: 5000 // 5 second timeout
302+
timeout: 1000
303303
});
304304

305305
// Count torrents by state

0 commit comments

Comments
 (0)