From e1caa4b91837c5a7092c4ad5b0e6a03f9265ba69 Mon Sep 17 00:00:00 2001 From: abetomo Date: Sun, 20 Oct 2024 10:27:06 +0900 Subject: [PATCH] v3: Add a comment about retry --- lib/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 432e3f1..70412f3 100644 --- a/lib/main.js +++ b/lib/main.js @@ -19,7 +19,14 @@ const CloudWatchLogs = require(path.join(__dirname, 'cloudwatch_logs')) const AWSXRay = require('aws-xray-sdk-core') const { createNamespace } = require('continuation-local-storage') -// Migrating to v3. +/* + * Migrating to v3. + * + * # About retry + * By default, each client already has a default retry strategy. + * The default retry count is 3, and only retryable errors will be retried. + * https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html + */ const { LambdaClient, CreateFunctionCommand } = require('@aws-sdk/client-lambda') const lambdaClient = new LambdaClient() @@ -693,7 +700,6 @@ Emulate only the body of the API Gateway event. _uploadNew (lambda, params) { if (process.env.USE_AWS_SDK_V3) { - // todo retry console.log('DEBUG: Use AWS SDK V3: CreateFunctionCommand()') const command = new CreateFunctionCommand(params) return lambdaClient.send(command)