Skip to content

Commit

Permalink
Increase S3 socket limit to 250
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude authored and kelson42 committed Nov 2, 2024
1 parent db306bd commit e824520
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/S3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import * as logger from './Logger.js'
import { Readable } from 'stream'
import { publicIpv4 } from 'public-ip'

import * as https from 'https'
import { NodeHttpHandler } from '@smithy/node-http-handler'

interface BucketParams {
Bucket: string
Key: string
Expand Down Expand Up @@ -34,6 +37,11 @@ class S3 {
}

public async initialise() {
const requestHandler = new NodeHttpHandler({
httpsAgent: new https.Agent({
maxSockets: 250,
}),
})
const s3UrlBase: any = new URL(this.url)
this.s3Handler = new S3Client({
credentials: {
Expand All @@ -43,6 +51,7 @@ class S3 {
endpoint: s3UrlBase.href,
forcePathStyle: s3UrlBase.protocol === 'http:',
region: this.region,
requestHandler,
})

return this.bucketExists(this.bucketName)
Expand Down

0 comments on commit e824520

Please sign in to comment.