mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 08:00:54 +00:00
Prevent self re-subscription
This commit is contained in:
@ -209,6 +209,10 @@ class Pubsub():
|
|||||||
:param topic_id: topic_id to subscribe to
|
:param topic_id: topic_id to subscribe to
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Already subscribed
|
||||||
|
if topic_id in self.my_topics:
|
||||||
|
return self.my_topics[topic_id]
|
||||||
|
|
||||||
# Map topic_id to blocking queue
|
# Map topic_id to blocking queue
|
||||||
self.my_topics[topic_id] = asyncio.Queue()
|
self.my_topics[topic_id] = asyncio.Queue()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user