diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index b87b2fcc92b0c4989a2a21bfdd3919472aae73bf..2370bc70cc4624ce1cfd9ada1c0a846461457781 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -1796,7 +1796,7 @@ Example: } ``` -### keepalive +### keepAlive If enabled, this allows a single TCP connection to remain open for multiple HTTP(S) requests/responses. diff --git a/lib/config/migrations/migrations-service.ts b/lib/config/migrations/migrations-service.ts index 80c473844df2f62f0cf86765109cf0ac85d862ac..1f6023a27aa6775034ba76808fb3f1c09616c373 100644 --- a/lib/config/migrations/migrations-service.ts +++ b/lib/config/migrations/migrations-service.ts @@ -84,6 +84,7 @@ export class MigrationsService { ['endpoints', 'hostRules'], ['excludedPackageNames', 'excludePackageNames'], ['exposeEnv', 'exposeAllEnv'], + ['keepalive', 'keepAlive'], ['managerBranchPrefix', 'additionalBranchPrefix'], ['multipleMajorPrs', 'separateMultipleMajor'], ['separatePatchReleases', 'separateMinorPatch'], diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index a3d0eed47ef5326ed3f99df36143db68f8a413c5..f452d97359ae0d56adb42fb04029ca5d0c1fb5b0 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -2349,8 +2349,8 @@ const options: RenovateOptions[] = [ experimental: true, }, { - name: 'keepalive', - description: 'Enable HTTP keepalives for hosts.', + name: 'keepAlive', + description: 'Enable HTTP keep-alive for hosts.', type: 'boolean', stage: 'repository', parent: 'hostRules', diff --git a/lib/types/host-rules.ts b/lib/types/host-rules.ts index 058ed21e1e6d306df4e353a6ccc4999e339e63f1..c8b26a1358da5861864e8e7745405d0d68be2007 100644 --- a/lib/types/host-rules.ts +++ b/lib/types/host-rules.ts @@ -13,7 +13,7 @@ export interface HostRuleSearchResult { maxRequestsPerSecond?: number; dnsCache?: boolean; - keepalive?: boolean; + keepAlive?: boolean; artifactAuth?: string[] | null; httpsCertificateAuthority?: string; httpsPrivateKey?: string; diff --git a/lib/util/http/host-rules.spec.ts b/lib/util/http/host-rules.spec.ts index adb46f9e4bc99f838e8e47a512d1f104488a1008..11c215d5edb4382e9375df3108b3582f11432bac 100644 --- a/lib/util/http/host-rules.spec.ts +++ b/lib/util/http/host-rules.spec.ts @@ -115,8 +115,8 @@ describe('util/http/host-rules', () => { }); }); - it('uses http keepalives', () => { - hostRules.add({ keepalive: true }); + it('uses http keep-alive', () => { + hostRules.add({ keepAlive: true }); expect( applyHostRules(url, { ...options, token: 'xxx' }).agent, ).toBeDefined(); diff --git a/lib/util/http/host-rules.ts b/lib/util/http/host-rules.ts index 7f5b52c293f0dfd63706d2cf14b232db251b80bd..d0346584f00838071f7a247896ca4f935aa5384b 100644 --- a/lib/util/http/host-rules.ts +++ b/lib/util/http/host-rules.ts @@ -11,7 +11,7 @@ import type { HostRule } from '../../types'; import * as hostRules from '../host-rules'; import { parseUrl } from '../url'; import { dnsLookup } from './dns'; -import { keepaliveAgents } from './keepalive'; +import { keepAliveAgents } from './keep-alive'; import type { GotOptions } from './types'; export type HostRulesGotOptions = Pick< @@ -163,8 +163,8 @@ export function applyHostRules<GotOptions extends HostRulesGotOptions>( options.lookup = dnsLookup; } - if (foundRules.keepalive) { - options.agent = keepaliveAgents; + if (foundRules.keepAlive) { + options.agent = keepAliveAgents; } if (!hasProxy() && foundRules.enableHttp2 === true) { diff --git a/lib/util/http/keepalive.ts b/lib/util/http/keep-alive.ts similarity index 73% rename from lib/util/http/keepalive.ts rename to lib/util/http/keep-alive.ts index abc46edfa16145c13ce49858a00a8f32f3667cb7..c98c5d84be7b9e1c60950b5d20b8dee31b8f1281 100644 --- a/lib/util/http/keepalive.ts +++ b/lib/util/http/keep-alive.ts @@ -4,9 +4,9 @@ import type { Agents } from 'got'; const http = new Agent(); const https = new HttpsAgent(); -const keepaliveAgents: Agents = { +const keepAliveAgents: Agents = { http, https, }; -export { keepaliveAgents }; +export { keepAliveAgents };