Skip to content

Commit 1d34567

Browse files
committed
Added comment explaining async initializer in springboot 2 archetyoe
1 parent a007be9 commit 1d34567

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

aws-serverless-springboot2-archetype/src/main/resources/archetype-resources/src/main/java/StreamLambdaHandler.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public class StreamLambdaHandler implements RequestStreamHandler {
1818
static {
1919
try {
2020
handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class);
21+
// For applications that take longer than 10 seconds to start, use the async builder:
22+
// long startTime = Instant.now().toEpochMilli();
23+
// handler = new SpringBootProxyHandlerBuilder()
24+
// .defaultProxy()
25+
// .asyncInit(startTime)
26+
// .springBootApplication(Application.class)
27+
// .buildAndInitialize();
2128
} catch (ContainerInitializationException e) {
2229
// if we fail here. We re-throw the exception to force another cold start
2330
e.printStackTrace();

0 commit comments

Comments
 (0)