-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Make it possible to disable the BackgroundPreinitializer #14298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to disable the BackgroundPreinitializer #14298
Conversation
Thanks for the PR. I think we can simplify this by bypassing all initialization if the property is set. The initialization code doesn't actually need to run at all. The reason we currently do it is to kick off in the background so that something called later runs quickly. Probably just returning early from this method if the property is set will be enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added a suggestion.
@@ -69,6 +69,7 @@ content into your application. Rather, pick only the properties that you need. | |||
|
|||
# SPRING CORE | |||
spring.beaninfo.ignore=true # Whether to skip search of BeanInfo classes. | |||
spring.backgroundpreinitializer.ignore=true # Whether background preinitializer should be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't add this here as it's not managed the same way as a regular property. Let's document the property and its usage on the class Javadoc instead.
… into make-possible-disable-backgroundpreinitializer
…undpreinitializer * pr/14298: Polish "Make it possible to disable the BackgroundPreinitializer" Make it possible to disable the BackgroundPreinitializer
Thanks @ayudovin, this is now merged in |
@snicoll, Thank you! |
this enhancement