change ipfs reconnect logic, use config vars

pull/8/head
Konstantine Tsafatinos 2023-06-26 09:59:32 -04:00
parent 8f24c72762
commit acd8ba91e5
1 changed files with 3 additions and 4 deletions

View File

@ -212,10 +212,9 @@ class SkynetGPUConnector:
img.save(f'ipfs-docker-staging/image.png') img.save(f'ipfs-docker-staging/image.png')
# check for connections to peers, reconnect if none # check for connections to peers, reconnect if none
peers = self.ipfs_node.check_connect() peers = self.ipfs_node.check_connect().splitlines()
if peers == "": if self.ipfs_url not in peers:
self.ipfs_node.connect( self.ipfs_node.connect(self.ipfs_url)
'/ip4/169.197.140.154/tcp/4001/p2p/12D3KooWKWogLFNEcNNMKnzU7Snrnuj84RZdMBg3sLiQSQc51oEv')
ipfs_hash = self.ipfs_node.add('image.png') ipfs_hash = self.ipfs_node.add('image.png')