mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-29 04:21:39 -04:00
5
.changeset/light-geese-peel.md
Normal file
5
.changeset/light-geese-peel.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/store-connection-manager": patch
|
||||
---
|
||||
|
||||
The maximum number of allowed connections increased to 3 times the number of network concurrency. This should fix the socket timeout issues that sometimes happen.
|
||||
5
.changeset/twenty-cats-return.md
Normal file
5
.changeset/twenty-cats-return.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/npm-registry-agent": patch
|
||||
---
|
||||
|
||||
Increase the default maximum number of connections to use per origin to 50 (from 15).
|
||||
@@ -7,6 +7,8 @@ import SocksProxyAgent = require('socks-proxy-agent')
|
||||
|
||||
const HttpsAgent = HttpAgent.HttpsAgent
|
||||
|
||||
const DEFAULT_MAX_SOCKETS = 50
|
||||
|
||||
const AGENT_CACHE = new LRU({ max: 50 })
|
||||
|
||||
export interface AgentOptions {
|
||||
@@ -64,13 +66,13 @@ export default function getAgent (uri: string, opts: AgentOptions) {
|
||||
cert: opts.cert,
|
||||
key: opts.key,
|
||||
localAddress: opts.localAddress,
|
||||
maxSockets: opts.maxSockets ?? 15,
|
||||
maxSockets: opts.maxSockets ?? DEFAULT_MAX_SOCKETS,
|
||||
rejectUnauthorized: opts.strictSSL,
|
||||
timeout: agentTimeout,
|
||||
} as any) // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
: new HttpAgent({
|
||||
localAddress: opts.localAddress,
|
||||
maxSockets: opts.maxSockets ?? 15,
|
||||
maxSockets: opts.maxSockets ?? DEFAULT_MAX_SOCKETS,
|
||||
timeout: agentTimeout,
|
||||
} as any) // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
AGENT_CACHE.set(key, agent)
|
||||
@@ -152,7 +154,7 @@ function getProxy (
|
||||
host: proxyUrl.hostname,
|
||||
key: opts.key,
|
||||
localAddress: opts.localAddress,
|
||||
maxSockets: opts.maxSockets ?? 15,
|
||||
maxSockets: opts.maxSockets ?? DEFAULT_MAX_SOCKETS,
|
||||
path: proxyUrl.pathname,
|
||||
port: proxyUrl.port,
|
||||
protocol: proxyUrl.protocol,
|
||||
|
||||
@@ -58,6 +58,8 @@ export default async (
|
||||
storeDir: opts.storeDir,
|
||||
strictSSL: opts.strictSsl ?? true,
|
||||
userAgent: opts.userAgent,
|
||||
maxSockets: opts.networkConcurrency != null
|
||||
? (opts.networkConcurrency * 3) : undefined,
|
||||
})
|
||||
await fs.mkdir(opts.storeDir, { recursive: true })
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user