Commit 66bf684e authored by Sébastien Deleuze's avatar Sébastien Deleuze Committed by Andy Wilkinson

Ignore BackgroundPreinitializer in native images

BackgroundPreinitializer is not relevant in native images so it is
better to ignore it automatically in order to reduce the footprint
in such environment.

See gh-22392
parent 85828953
...@@ -45,6 +45,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage ...@@ -45,6 +45,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Artsiom Yudovin * @author Artsiom Yudovin
* @author Sebastien Deleuze
* @since 1.3.0 * @since 1.3.0
*/ */
@Order(LoggingApplicationListener.DEFAULT_ORDER + 1) @Order(LoggingApplicationListener.DEFAULT_ORDER + 1)
...@@ -67,6 +68,7 @@ public class BackgroundPreinitializer implements ApplicationListener<SpringAppli ...@@ -67,6 +68,7 @@ public class BackgroundPreinitializer implements ApplicationListener<SpringAppli
static { static {
ENABLED = !Boolean.getBoolean(IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME) ENABLED = !Boolean.getBoolean(IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME)
&& System.getProperty("org.graalvm.nativeimage.imagecode") == null
&& Runtime.getRuntime().availableProcessors() > 1; && Runtime.getRuntime().availableProcessors() > 1;
} }
......
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