serverless-plugin-warmup 8.1.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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/warmer.js +5 -8
package/README.md
CHANGED
package/package.json
CHANGED
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)
|
|
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) {
|
|
@@ -223,7 +220,7 @@ function addWarmUpFunctionToService(service, warmerName, warmerConfig) {
|
|
|
223
220
|
memorySize: warmerConfig.memorySize,
|
|
224
221
|
name: warmerConfig.name,
|
|
225
222
|
...(warmerConfig.architecture ? { architecture: warmerConfig.architecture } : {}),
|
|
226
|
-
runtime: '
|
|
223
|
+
runtime: 'nodejs18.x',
|
|
227
224
|
package: warmerConfig.package,
|
|
228
225
|
timeout: warmerConfig.timeout,
|
|
229
226
|
...(Object.keys(warmerConfig.environment).length
|