Skip to content

Commit

Permalink
refactor: add api timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuki-joto committed May 17, 2024
1 parent f4d4986 commit 5b8cb24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/footprint-stack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib'
import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib'
import { Construct } from 'constructs'
import { BaseStackProps } from './props'
import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'
Expand All @@ -25,7 +25,8 @@ export class FootprintStack extends Stack {
environment: {
TABLE_NAME: props.dynamoTable.tableName
},
tracing: Tracing.ACTIVE
tracing: Tracing.ACTIVE,
timeout: Duration.seconds(10)
}
)
props.dynamoTable.grantReadData(this.lambda)
Expand Down
5 changes: 3 additions & 2 deletions lib/profile-stack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib'
import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib'
import { Construct } from 'constructs'
import { BaseStackProps } from './props'
import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'
Expand Down Expand Up @@ -31,7 +31,8 @@ export class ProfileStack extends Stack {
PROFILE_TABLE_NAME: props.profileTable.tableName,
OPTION_TABLE_NAME: props.optionTable.tableName
},
tracing: Tracing.ACTIVE
tracing: Tracing.ACTIVE,
timeout: Duration.seconds(10)
}
)
props.footprintTable.grantReadData(this.lambda)
Expand Down
5 changes: 3 additions & 2 deletions lib/share-stack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib'
import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib'
import { Construct } from 'constructs'
import { BaseStackProps } from './props'
import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'
Expand All @@ -22,7 +22,8 @@ export class ShareStack extends Stack {
environment: {
TABLE_NAME: props.dynamoTable.tableName
},
tracing: Tracing.ACTIVE
tracing: Tracing.ACTIVE,
timeout: Duration.seconds(10)
})
props.dynamoTable.grantReadData(this.lambda)
}
Expand Down

0 comments on commit 5b8cb24

Please sign in to comment.