From 9cfa5bb188fc84d4d0525ad910701841ac4a076c Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Thu, 15 Feb 2024 12:47:07 +0100 Subject: [PATCH] Optimize pulling out aws-sdk dynamodb object. --- src/dynamoDbSafe.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/dynamoDbSafe.js b/src/dynamoDbSafe.js index e94ea86..d4c8f61 100644 --- a/src/dynamoDbSafe.js +++ b/src/dynamoDbSafe.js @@ -1,9 +1,6 @@ -const { DynamoDB: DynamoDbOriginal, config } = require('aws-sdk'); +const DynamoDbOriginal = require('aws-sdk/clients/dynamodb'); process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1; -require('http').globalAgent.keepAlive = true; -require('https').globalAgent.keepAlive = true; -config.update({ maxRetries: 5, httpOptions: { connectTimeout: 1000, timeout: 10000 } }); const DynamoDbError = require('./dynamoDbError');