Skip to content

Commit

Permalink
fix(AWS HTTP API): Do not validate timeout when no httpApi event
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Mar 17, 2020
1 parent 2a0f786 commit 841aac9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/plugins/aws/package/compile/events/httpApi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@ Object.defineProperties(
functionAlias: functionData.targetAlias,
functionLogicalId: this.provider.naming.getLambdaLogicalId(functionName),
};
let hasHttpApiEvents = false;
for (const event of functionData.events) {
if (!event.httpApi) continue;
hasHttpApiEvents = true;
let method;
let path;
let authorizer;
Expand Down Expand Up @@ -384,6 +386,7 @@ Object.defineProperties(
}
}
}
if (!hasHttpApiEvents) continue;
const functionTimeout =
Number(functionData.timeout) || Number(this.serverless.service.provider.timeout) || 6;
if (routeTargetData.timeout) {
Expand Down

0 comments on commit 841aac9

Please sign in to comment.