serverless-plugin-warmup 8.2.0 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/warmer.js +4 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-plugin-warmup",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "description": "Keep your lambdas warm during winter.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/warmer.js CHANGED
@@ -132,14 +132,11 @@ async function createWarmUpFunctionArtifact(functions, tracing, verbose, region,
132
132
 
133
133
  ${tracing
134
134
  ? `const AWSXRay = require('aws-xray-sdk-core');
135
- const AWS = AWSXRay.captureAWS(require('aws-sdk'));`
136
- : 'const AWS = require(\'aws-sdk\')'};
135
+ const AWS = AWSXRay.captureAWS(require('@aws-sdk/client-lambda'));`
136
+ : 'const AWS = require(\'@aws-sdk/client-lambda\')'};
137
137
  const lambda = new AWS.Lambda({
138
138
  apiVersion: '2015-03-31',
139
- region: '${region}',
140
- httpOptions: {
141
- connectTimeout: 1000, // 1 second
142
- },
139
+ region: '${region}'
143
140
  });
144
141
  const functions = ${JSON.stringify(functions, null, ' ')};
145
142
 
@@ -189,7 +186,7 @@ module.exports.warmUp = async (event, context) => {
189
186
  };
190
187
 
191
188
  try {
192
- await Promise.all(Array(concurrency).fill(0).map(async () => await lambda.invoke(params).promise()));
189
+ await Promise.all(Array(concurrency).fill(0).map(async () => await lambda.invoke(params)));
193
190
  logVerbose(\`Warm Up Invoke Success: \${func.name}\`);
194
191
  return true;
195
192
  } catch (e) {