Skip to content

Commit 420f398

Browse files
committed
Fix warmer event
1 parent 9855c5c commit 420f398

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/api/lambda.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ const handler = async (
1414
event: APIGatewayEvent | WarmerEvent,
1515
context: Context,
1616
) => {
17-
if ("action" in event) {
18-
console.log(`Got warmer event for instance ID ${instanceId}.`);
19-
return {
20-
instanceId,
21-
};
17+
if ("action" in event && event.action === "warmer") {
18+
return { instanceId };
2219
}
20+
event = event as APIGatewayEvent;
2321
if (process.env.ORIGIN_VERIFY_KEY) {
2422
// check that the request has the right header (coming from cloudfront)
2523
if (

0 commit comments

Comments
 (0)