We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e4af43 commit be88b42Copy full SHA for be88b42
hivemind/hivemind_cli/run_dht.py
@@ -1,5 +1,6 @@
1
import time
2
from argparse import ArgumentParser
3
+from secrets import token_hex
4
5
from hivemind.dht import DHT, DHTNode
6
from hivemind.utils.logging import get_logger, use_hivemind_log_handler
@@ -18,6 +19,9 @@ async def report_status(dht: DHT, node: DHTNode):
18
19
logger.info(f"Local storage contains {len(node.protocol.storage)} keys")
20
logger.debug(f"Local storage contents: {node.protocol.storage}")
21
22
+ # Contact peers and keep the routing table healthy (remove stale PeerIDs)
23
+ await node.get(f"heartbeat_{token_hex(16)}", latest=True)
24
+
25
26
def main():
27
parser = ArgumentParser()
0 commit comments