Skip to content

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

Conversation

ayudovin
Copy link
Contributor

@ayudovin ayudovin commented Sep 4, 2018

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 4, 2018
@philwebb
Copy link
Member

philwebb commented Sep 4, 2018

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.

@philwebb philwebb added for: merge-with-amendments Needs some changes when we merge status: waiting-for-feedback We need additional information before we can continue labels Sep 4, 2018
Copy link
Member

@snicoll snicoll left a 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.
Copy link
Member

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.

@snicoll snicoll self-assigned this Sep 5, 2018
@snicoll snicoll added this to the 2.1.0.M3 milestone Sep 5, 2018
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Sep 5, 2018
@snicoll snicoll closed this in 304c6a0 Sep 5, 2018
snicoll added a commit that referenced this pull request Sep 5, 2018
…undpreinitializer

* pr/14298:
  Polish "Make it possible to disable the BackgroundPreinitializer"
  Make it possible to disable the BackgroundPreinitializer
@snicoll
Copy link
Member

snicoll commented Sep 5, 2018

Thanks @ayudovin, this is now merged in master with a polish commit.

@ayudovin
Copy link
Contributor Author

ayudovin commented Sep 5, 2018

@snicoll, Thank you!

@gdespres

This comment has been minimized.

@dsyer

This comment has been minimized.

@gdespres

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants