Commit 70f7e470 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Use Duration for ServerProperties.Jetty.idleTimeout"

See gh-18206
parent 96019362
...@@ -86,9 +86,8 @@ public class JettyWebServerFactoryCustomizer ...@@ -86,9 +86,8 @@ public class JettyWebServerFactoryCustomizer
.to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads))); .to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads)));
propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive) propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive)
.to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads))); .to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads)));
propertyMapper.from(jettyProperties::getIdleTimeout).whenNonNull() propertyMapper.from(jettyProperties::getIdleTimeout).whenNonNull().asInt(Duration::toMillis).to(
.to((idleTimeout) -> customizeThreadPool(factory, (idleTimeout) -> customizeThreadPool(factory, (threadPool) -> threadPool.setIdleTimeout(idleTimeout)));
(threadPool) -> threadPool.setIdleTimeout((int) idleTimeout.toMillis())));
propertyMapper.from(properties::getConnectionTimeout).whenNonNull() propertyMapper.from(properties::getConnectionTimeout).whenNonNull()
.to((connectionTimeout) -> customizeConnectionTimeout(factory, connectionTimeout)); .to((connectionTimeout) -> customizeConnectionTimeout(factory, connectionTimeout));
propertyMapper.from(jettyProperties::getAccesslog).when(ServerProperties.Jetty.Accesslog::isEnabled) propertyMapper.from(jettyProperties::getAccesslog).when(ServerProperties.Jetty.Accesslog::isEnabled)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment