Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e1b617a

Browse files
committed
review
1 parent e72b0ea commit e1b617a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

‎packages/aws-serverless/src/init.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,20 @@ export function init(options: AwsServerlessOptions = {}): NodeClient | undefined
3636

3737
const sdkSource = getSDKSource();
3838

39-
if (opts._experiments?.enableLambdaExtension && sdkSource === 'aws-lambda-layer' && !opts.tunnel) {
40-
DEBUG_BUILD && debug.log('Proxying Sentry events through the Sentry Lambda extension');
41-
opts.tunnel = 'http://localhost:9000/envelope';
39+
if (opts._experiments?.enableLambdaExtension) {
40+
if (sdkSource === 'aws-lambda-layer') {
41+
if (!opts.tunnel) {
42+
DEBUG_BUILD && debug.log('Proxying Sentry events through the Sentry Lambda extension');
43+
opts.tunnel = 'http://localhost:9000/envelope';
44+
} else {
45+
DEBUG_BUILD &&
46+
debug.warn(
47+
`Using a custom tunnel with the Sentry Lambda extension is not supported. Events will be tunnelled to ${opts.tunnel} and not through the extension.`,
48+
);
49+
}
50+
} else {
51+
DEBUG_BUILD && debug.warn('The Sentry Lambda extension is only supported when using the AWS Lambda layer.');
52+
}
4253
}
4354

4455
applySdkMetadata(opts, 'aws-serverless', ['aws-serverless'], sdkSource);

‎packages/aws-serverless/src/lambda-extension/aws-lambda-extension.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ export class AwsLambdaExtension {
5555
if (!res.ok) {
5656
throw new Error(`Failed to advance to next event: ${await res.text()}`);
5757
}
58-
59-
const event = (await res.json()) as { eventType: string };
60-
61-
if (event.eventType === 'SHUTDOWN') {
62-
await new Promise(resolve => setTimeout(resolve, 1000));
63-
}
6458
}
6559

6660
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /