more sockets?

This commit is contained in:
Luke Berndt
2024-08-13 15:35:10 -04:00
parent bb72f1e538
commit 85ea4579dc
3 changed files with 90 additions and 3 deletions

View File

@@ -9,6 +9,13 @@ var { callModel: Call } = require("../models/call");
const { PutObjectCommand, S3Client } = require("@aws-sdk/client-s3");
const { fromIni } = require("@aws-sdk/credential-providers");
const { NodeHttpHandler } = require('@smithy/node-http-handler');
const https = require('https');
const agent = new https.Agent({
maxSockets: 150
});
var s3_endpoint = process.env['S3_ENDPOINT'] != null ? process.env['S3_ENDPOINT'] : 'https://s3.us-west-1.wasabisys.com';
var s3_region = process.env['S3_REGION'] != null ? process.env['S3_REGION'] : 'us-west-1';
@@ -17,10 +24,14 @@ var s3_profile = process.env['S3_PROFILE'] != null ? process.env['S3_PROFILE'] :
const client = new S3Client({
requestHandler: new NodeHttpHandler({
httpsAgent: agent
}),
credentials: fromIni({ profile: s3_profile }),
endpoint: s3_endpoint,
region: s3_region,
maxAttempts: 3
});
exports.upload = async function (req, res, next) {