diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index fb014fe8..0179bdf4 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -1474,6 +1474,7 @@ micronaut { inferClasspath = true // true by default additionalModules.add(JDBC_MYSQL) // empty by default clientTimeout = 60 // in seconds, maximum time to wait for resources to be available, 60s by default + serverIdleTimeoutMinutes = 60 // if the server doesn't receive any request for this amount of time, it will be shut down sharedServer = true // false by default sharedServerNamespace = 'custom' // unset by default } @@ -2020,4 +2021,3 @@ In addition, the official GraalVM plugin makes use of Gradle toolchains support, then we recommend tweaking toolchain detection as described in <<#toolchain-behavior, this section of the documentation>>. In any case, make sure to follow the <<#native-image,configuration instructions>>. - diff --git a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/MicronautTestResourcesPlugin.java b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/MicronautTestResourcesPlugin.java index 13e04840..9262b536 100644 --- a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/MicronautTestResourcesPlugin.java +++ b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/MicronautTestResourcesPlugin.java @@ -244,6 +244,7 @@ private TaskProvider createStartServiceTask(Configura task.getAccessToken().convention(accessToken); task.getExplicitPort().convention(config.getExplicitPort()); task.getClientTimeout().convention(config.getClientTimeout()); + task.getServerIdleTimeoutMinutes().convention(config.getServerIdleTimeoutMinutes()); task.getClasspath().from(server); task.getForeground().convention(false); task.getStopFile().set(stopFile.toFile()); diff --git a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/TestResourcesConfiguration.java b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/TestResourcesConfiguration.java index 534c19b7..eff45c55 100644 --- a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/TestResourcesConfiguration.java +++ b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/TestResourcesConfiguration.java @@ -101,4 +101,13 @@ public interface TestResourcesConfiguration extends KnownModules { * @return the namespace */ Property getSharedServerNamespace(); + + /** + * Server idle timeout, in minutes. If the server + * doesn't receive any request for this amount of + * time, it will stop itself. + * + * @return the server idle timeout + */ + Property getServerIdleTimeoutMinutes(); }