Skip to content

Commit 090de1d

Browse files
committed
fix: cold start only on on-demand invocation
1 parent 5ec3c21 commit 090de1d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

powertools-common/src/main/java/software/amazon/lambda/powertools/common/internal/LambdaHandlerProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ public static boolean isColdStart() {
9898
}
9999

100100
String initType = System.getenv(LambdaConstants.AWS_LAMBDA_INITIALIZATION_TYPE);
101-
boolean cold = LambdaConstants.ON_DEMAND_INVOCATION_TYPE.equals(initType);
101+
isColdStart = LambdaConstants.ON_DEMAND_INVOCATION_TYPE.equals(initType);
102102

103-
isColdStart = cold;
104-
return cold;
103+
return isColdStart;
105104
}
106105

107106
public static void coldStartDone() {

0 commit comments

Comments
 (0)