Skip to content

Instantly share code, notes, and snippets.

@vikasontech
Created October 16, 2020 10:45
Show Gist options
  • Save vikasontech/96a941dc6dfeddf08743972695662b97 to your computer and use it in GitHub Desktop.
Save vikasontech/96a941dc6dfeddf08743972695662b97 to your computer and use it in GitHub Desktop.
@Bean
@Suppress("unused")
fun servletWebServerFactory(applicationConfig: ApplicationConfig): ServletWebServerFactory {
val serverFactory = TomcatServletWebServerFactory()
serverFactory.addContextCustomizers(TomcatContextCustomizer {
if (it is StandardContext) {
val context = it
log.info("Current context unloadDelay: {}", context.unloadDelay)
context.unloadDelay = Duration.ofMinutes(2).toMillis()
log.info("Updated context unloadDelay: {}", context.unloadDelay)
}
})
return serverFactory
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment