Skip to content
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

Implement Lazy Initialization to Prevent Warnings for Deprecated Services #1169

Merged

Conversation

onefloid
Copy link
Contributor

@onefloid onefloid commented Oct 15, 2024

Description

This Pull Request introduces lazy initialization for MonitoringService and ServerService, effectively reducing the occurrence of warnings related to these deprecated services. By instantiating these services in TM1Service only when they are actually needed, we minimize the warnings for the majority of use cases where these services are not used.

Furthermore, this PR suppresses expected warnings in tests: This allows the tests to run without cluttering the output with warnings that were anticipated.

Benefits

  • Cleaner Output: By avoiding unnecessary warnings, the console output during development and testing is cleaner and easier to read.

  • Focus on warnings where developer action is required.

Thread Safety Consideration

Please note that this implementation is not thread-safe. If needed, we have to rewrite some parts of the PR.

@MariusWirtz
Copy link
Collaborator

MariusWirtz commented Nov 12, 2024

I don't think it would be reasonable to complicate the code and assure thread safety for these two deprecated services.

Happy to merge as is.

@MariusWirtz MariusWirtz merged commit 398105b into cubewise-code:master Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants