Skip to content

Commit

Permalink
feat: update edge endpoint in auto trace
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Sep 14, 2024
1 parent 6ec42eb commit 077aa3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/api/src/events/auto-trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const autoTrace = async () => {
const isTraceStack = envVars.LAMBDA_LAYER_ARN === arn;
const isUpdating = lambda.LastUpdateStatus === "InProgress";
const hasDisableEnvVar = envVars.AUTO_TRACE_EXCLUDE;
const hasWrongEndpoint = envVars.AUTO_TRACE_HOST !== edgeEndpoint;
const hasOtherWrapper =
envVars.AWS_LAMBDA_EXEC_WRAPPER &&
envVars.AWS_LAMBDA_EXEC_WRAPPER !== lambdaExecWrapper;
Expand All @@ -161,7 +162,7 @@ export const autoTrace = async () => {
({ Arn }) => Arn.startsWith(arnBase) && Arn !== arn,
);

if (hasLayer && !hasUpdate) {
if (hasLayer && !hasUpdate && !hasWrongEndpoint) {
logger.info(`- ${lambda.FunctionName} already has the latest layer`);
await saveFunctionInfo(lambda, "enabled");
return;
Expand Down

0 comments on commit 077aa3a

Please sign in to comment.