From f96ed9a3f3250372af374218989bcc474ade04c7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Jul 2023 20:07:31 +0900 Subject: [PATCH] fix type errors --- packages/backend/src/core/HttpRequestService.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 4f2c26114..3bb999ff8 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -1,5 +1,6 @@ import * as http from 'node:http'; import * as https from 'node:https'; +import * as net from 'node:net'; import CacheableLookup from 'cacheable-lookup'; import fetch from 'node-fetch'; import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent'; @@ -46,14 +47,14 @@ export class HttpRequestService { this.http = new http.Agent({ keepAlive: true, keepAliveMsecs: 30 * 1000, - lookup: cache.lookup, - } as http.AgentOptions); + lookup: cache.lookup as unknown as net.LookupFunction, + }); this.https = new https.Agent({ keepAlive: true, keepAliveMsecs: 30 * 1000, - lookup: cache.lookup, - } as https.AgentOptions); + lookup: cache.lookup as unknown as net.LookupFunction, + }); const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128); @@ -144,7 +145,7 @@ export class HttpRequestService { method: args.method ?? 'GET', headers: { 'User-Agent': this.config.userAgent, - ...(args.headers ?? {}) + ...(args.headers ?? {}), }, body: args.body, size: args.size ?? 10 * 1024 * 1024,