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

Fix singleton implementation of OmenSubgraphHandler #485

Closed
coderabbitai bot opened this issue Sep 23, 2024 · 1 comment
Closed

Fix singleton implementation of OmenSubgraphHandler #485

coderabbitai bot opened this issue Sep 23, 2024 · 1 comment

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

The current singleton implementation of OmenSubgraphHandler appears to be buggy. The __init__ method is being called every time an instance is created, indicating that the Singleton pattern is not working as intended.

Please refer to the discussion in PR #482 Comment.

Requester: @kongzii

@gabrielfior
Copy link
Contributor

Singleton working as expected.

if __name__ == "__main__":
    print("start")
    a = OmenSubgraphHandler()
    b = OmenSubgraphHandler()
    print(a, b)
    print("end")

start
a
<prediction_market_agent_tooling.markets.omen.omen_subgraph_handler.OmenSubgraphHandler object at 0x1372e0050> <prediction_market_agent_tooling.markets.omen.omen_subgraph_handler.OmenSubgraphHandler object at 0x1372e0050>
end

Closing this since not needed.

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

No branches or pull requests

2 participants