mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
fix: assign the keep-alive value explicitly (#1368)
* fix: assign the keep-alive value explicitly The Node.js documentation mentions that the default keep-alive value is not used when creating a global agent manually, which is done in customProxyAgent.ts. re #1365 * fix: typo
This commit is contained in:
@@ -6,7 +6,7 @@ import { Agent, ProxyAgent, setGlobalDispatcher } from 'undici';
|
|||||||
export default async function createCustomProxyAgent(
|
export default async function createCustomProxyAgent(
|
||||||
proxySettings: ProxySettings
|
proxySettings: ProxySettings
|
||||||
) {
|
) {
|
||||||
const defaultAgent = new Agent();
|
const defaultAgent = new Agent({ keepAliveTimeout: 5000 });
|
||||||
|
|
||||||
const skipUrl = (url: string) => {
|
const skipUrl = (url: string) => {
|
||||||
const hostname = new URL(url).hostname;
|
const hostname = new URL(url).hostname;
|
||||||
@@ -63,6 +63,7 @@ export default async function createCustomProxyAgent(
|
|||||||
interceptors: {
|
interceptors: {
|
||||||
Client: [noProxyInterceptor],
|
Client: [noProxyInterceptor],
|
||||||
},
|
},
|
||||||
|
keepAliveTimeout: 5000,
|
||||||
});
|
});
|
||||||
|
|
||||||
setGlobalDispatcher(proxyAgent);
|
setGlobalDispatcher(proxyAgent);
|
||||||
|
|||||||
Reference in New Issue
Block a user