Skip to content

Commit

Permalink
fix: ignore inline funcs during cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Aug 23, 2023
1 parent 07a293f commit 50b30f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "samp-cli",
"version": "1.0.46",
"version": "1.0.47",
"description": "CLI tool for extended productivity with AWS Serverless Application Model (SAM)",
"main": "index.js",
"scripts": {
Expand Down
18 changes: 10 additions & 8 deletions src/commands/local/lib/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ const updatePromises = functions.map(async functionName => {
bucket = bucket.replace("${AWS::AccountId}", conf.accountId);
bucket = bucket.replace("${AWS::Region}", conf.envConfig.region);
}
const params = {
FunctionName: physicalId,
Publish: true,
S3Bucket: bucket,
S3Key: func.Properties.Code.S3Key,
};

await lambdaClient.send(new UpdateFunctionCodeCommand(params));
if (func.Properties?.Code?.S3Key) {
const params = {
FunctionName: physicalId,
Publish: true,
S3Bucket: bucket,
S3Key: func.Properties.Code.S3Key,
};

await lambdaClient.send(new UpdateFunctionCodeCommand(params));
}
updated = true;

} catch (error) {
if (error.name === "TooManyRequestsException") {
console.log("Too many requests, sleeping for 1 second");
Expand Down

0 comments on commit 50b30f9

Please sign in to comment.