Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix: Implement Singleton pattern for DbCodeGate initialization #625

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multiple initializations of DB during startup
3 participants