Skip to content

Fix: Implement Singleton pattern for DbCodeGate initialization #625

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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

marleen01
Copy link
Contributor

Overview

This PR fixes the issue of multiple initializations of the DbCodeGate class, which occurs when DbRecorder and DbReader are instantiated multiple times.

Changes

  • Applied the Singleton Pattern to DbCodeGate to ensure only one instance exists.
  • Modified __new__ and __init__ methods in DbCodeGate to prevent redundant initializations.

Closes

Closes #545

Copy link
Contributor

@aponcedeleonch aponcedeleonch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thanks for the contribution

@lukehinds lukehinds merged commit bec0db5 into stacklok:main Jan 17, 2025
4 checks passed
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.

multiple initializations of DB during startup
3 participants