Skip to content

CLI instance is now created and initialized lazily #1615

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

Closed
wants to merge 1 commit into from

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Enhances the handling of the internal instance used by the cli package.

  • What is the current behavior?

The functions that create and initialize the internal instance used in the cli package never check if an instance has been already created nor initialized.

Subsequent calls of instance.Create would create multiple instances, calling instance.Init would reinitialized the specified instance even if already initialized.

  • What is the new behavior?

The functions that create and initialize the internal instance used in the cli package now check if an instance has been already created nor initialized.

Calling of instance.Create will create a new instance and cache it, suqsequent calls will return the same instance.
Calling instance.Init won't reinitialized the specified instance if already initialized.

Nope.

  • Other information:

Closes #1453.


See how to contribute

@silvanocerza silvanocerza added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Jan 5, 2022
@silvanocerza silvanocerza requested a review from cmaglie January 5, 2022 15:42
@silvanocerza silvanocerza self-assigned this Jan 5, 2022
@silvanocerza
Copy link
Contributor Author

Closing this as it will superseded by a future more featureful PR.

@silvanocerza silvanocerza deleted the scerza/lazy-instance branch February 25, 2022 08:58
@per1234 per1234 added the conclusion: duplicate Has already been submitted label Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor cli package to use a global instance
2 participants