Skip to content

Commit

Permalink
Fix timer launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
nightfury1204 committed May 29, 2024
1 parent cd22644 commit a7beb80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions provider/aws/formation/app.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@
"Timeout": 60,
"Code": {
"ZipFile": { "Fn::Join": [ "\n", [
"exports.handler = function(event, context, cb) {",
"const { ECSClient, RunTaskCommand } = require('@aws-sdk/client-ecs')",
"exports.handler = async function(event, context, cb) {",
" var params = {",
{ "Fn::If": [ "FargateTimersBase",
" capacityProviderStrategy: [{capacityProvider: 'FARGATE'}],",
Expand Down Expand Up @@ -482,12 +483,14 @@
" }",
" }",
" };",
" var aws = require('aws-sdk');",
" var ecs = new aws.ECS({maxRetries:10});",
" ecs.runTask(params, function (err, res) {",
" console.log('res', res);",
" cb(err);",
" });",
" const ecsClient = new ECSClient({maxRetries:10});",
" try {",
" const command = new RunTaskCommand(params);",
" const response = await ecsClient.send(command);",
" cb(null);",
" } catch (error) {",
" cb(error);",
" }",
"};"
] ] }
},
Expand Down
2 changes: 1 addition & 1 deletion provider/aws/formation/g1/app.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@
"Properties": {
"Handler": "index.handler",
"Role": { "Fn::GetAtt": [ "CronRole", "Arn" ] },
"Runtime": "nodejs20.x",
"Runtime": "nodejs16.x",
"Timeout": 50,
"Code": {
"ZipFile": { "Fn::Join": ["\n", [
Expand Down

0 comments on commit a7beb80

Please sign in to comment.