chore (fetcher): increase timeout to 15s #64

Merged
webstreamr merged 2 commits from webstreamr-patch-1 into main 2025-05-20 19:17:31 +00:00
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ describe('fetch', () => {
'Referer': 'https://some-url.test', 'Referer': 'https://some-url.test',
}, },
responseType: 'text', responseType: 'text',
timeout: 10000, timeout: 15000,
}, },
); );
}); });
@ -55,7 +55,7 @@ describe('fetch', () => {
'Referer': 'https://some-url.test', 'Referer': 'https://some-url.test',
}, },
responseType: 'text', responseType: 'text',
timeout: 10000, timeout: 15000,
}, },
); );
@ -70,7 +70,7 @@ describe('fetch', () => {
'Referer': 'https://some-url.test', 'Referer': 'https://some-url.test',
}, },
responseType: 'text', responseType: 'text',
timeout: 10000, timeout: 15000,
}, },
); );
}); });

View file

@ -34,7 +34,7 @@ export class Fetcher {
private readonly getConfig = (ctx: Context, url: URL, config?: AxiosRequestConfig): AxiosRequestConfig => { private readonly getConfig = (ctx: Context, url: URL, config?: AxiosRequestConfig): AxiosRequestConfig => {
return { return {
responseType: 'text', responseType: 'text',
timeout: 10000, timeout: 15000,
...config, ...config,
headers: { headers: {
'User-Agent': this.createUserAgentForIp(ctx.ip), 'User-Agent': this.createUserAgentForIp(ctx.ip),