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

don't return result twice in query() #1574

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bittensor/dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def query(
returns the response from that axon. If multiple target axons are provided,
returns a list of responses from all target axons.
"""
result = None
try:
loop = asyncio.get_event_loop()
result = loop.run_until_complete(self.forward(*args, **kwargs))
Expand All @@ -231,7 +232,6 @@ def query(
asyncio.set_event_loop(new_loop)
result = loop.run_until_complete(self.forward(*args, **kwargs))
new_loop.close()
return result
finally:
self.close_session()
return result
Expand Down