Skip to content

Commit 80817a2

Browse files
authored
feat(lambda): increase timeout to 5 minutes #3954
1 parent 1d8e3f0 commit 80817a2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/shared/clients/lambdaClient.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ import { getLogger } from '../logger'
1111
import { ClassToInterfaceType } from '../utilities/tsUtils'
1212

1313
export type LambdaClient = ClassToInterfaceType<DefaultLambdaClient>
14+
1415
export class DefaultLambdaClient {
15-
public constructor(public readonly regionCode: string) {}
16+
private readonly defaultTimeoutInMs: number
17+
18+
public constructor(public readonly regionCode: string) {
19+
this.defaultTimeoutInMs = 5 * 60 * 1000 // 5 minutes (SDK default is 2 minutes)
20+
}
1621

1722
public async deleteFunction(name: string): Promise<void> {
1823
const sdkClient = await this.createSdkClient()
@@ -116,6 +121,10 @@ export class DefaultLambdaClient {
116121
}
117122

118123
private async createSdkClient(): Promise<Lambda> {
119-
return await globals.sdkClientBuilder.createAwsService(Lambda, undefined, this.regionCode)
124+
return await globals.sdkClientBuilder.createAwsService(
125+
Lambda,
126+
{ httpOptions: { timeout: this.defaultTimeoutInMs } },
127+
this.regionCode
128+
)
120129
}
121130
}

0 commit comments

Comments
 (0)