Skip to content

Commit 737cb1b

Browse files
committed
init thread pool executor for mvc
1 parent 3cdda22 commit 737cb1b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

generators/server/generator.mjs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,19 @@ logging:
262262
);
263263
},
264264

265-
async jwt({ application: { authenticationTypeOauth2 } }) {
265+
async asyncConfiguration({ application: { authenticationTypeOauth2, reactive, packageFolder } }) {
266+
if (authenticationTypeOauth2) return;
267+
if (!reactive) {
268+
const asyncConfigurationPath = `${SERVER_MAIN_SRC_DIR}${packageFolder}/config/AsyncConfiguration.java`;
269+
this.editFile(asyncConfigurationPath, content =>
270+
content.replace(
271+
'return new ExceptionHandlingAsyncTaskExecutor(executor);',
272+
'executor.initialize();\nreturn new ExceptionHandlingAsyncTaskExecutor(executor);'
273+
)
274+
);
275+
}
276+
},
277+
async jwt({ application: { authenticationTypeOauth2, reactive } }) {
266278
if (authenticationTypeOauth2) return;
267279
await this.copyTemplate(
268280
'src/main/resources/META-INF/native-image/jwt/reflect-config.json',
@@ -272,6 +284,12 @@ logging:
272284
'src/main/resources/META-INF/native-image/jwt/resource-config.json',
273285
'src/main/resources/META-INF/native-image/jwt/resource-config.json'
274286
);
287+
if (!reactive) {
288+
await this.copyTemplate(
289+
'src/main/resources/META-INF/native-image/common/reflect-config.json',
290+
'src/main/resources/META-INF/native-image/common/reflect-config.json'
291+
);
292+
}
275293
},
276294

277295
async liquibase({ application: { databaseTypeSql } }) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"name": "java.util.Locale",
4+
"allDeclaredFields": true,
5+
"allDeclaredMethods": true
6+
}
7+
]

0 commit comments

Comments
 (0)