Skip to content

Commit 0e2f7e2

Browse files
committed
Merge branch '4.0.x'
Closes gh-50234
2 parents 56059cf + 813913c commit 0e2f7e2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

core/spring-boot/src/main/java/org/springframework/boot/task/ThreadPoolTaskSchedulerBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public <T extends ThreadPoolTaskScheduler> T configure(T taskScheduler) {
212212
PropertyMapper map = PropertyMapper.get();
213213
map.from(this.poolSize).to(taskScheduler::setPoolSize);
214214
map.from(this.awaitTermination).to(taskScheduler::setWaitForTasksToCompleteOnShutdown);
215-
map.from(this.awaitTerminationPeriod).asInt(Duration::getSeconds).to(taskScheduler::setAwaitTerminationSeconds);
215+
map.from(this.awaitTerminationPeriod).as(Duration::toMillis).to(taskScheduler::setAwaitTerminationMillis);
216216
map.from(this.threadNamePrefix).to(taskScheduler::setThreadNamePrefix);
217217
map.from(this.taskDecorator).to(taskScheduler::setTaskDecorator);
218218
if (!CollectionUtils.isEmpty(this.customizers)) {

core/spring-boot/src/test/java/org/springframework/boot/task/ThreadPoolTaskSchedulerBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void awaitTerminationShouldApply() {
5454

5555
@Test
5656
void awaitTerminationPeriodShouldApply() {
57-
Duration period = Duration.ofMinutes(1);
57+
Duration period = Duration.ofMillis(50);
5858
ThreadPoolTaskScheduler executor = this.builder.awaitTerminationPeriod(period).build();
5959
assertThat(executor).hasFieldOrPropertyWithValue("awaitTerminationMillis", period.toMillis());
6060
}

0 commit comments

Comments
 (0)