+ Now log running seconds in heartbeat

* Do not spam "could not connect to any peer" if we have a peer connected
This commit is contained in:
Kevin Froman 2018-06-26 00:26:01 -05:00
parent 6fd0f9aded
commit 92b0ad975f
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B

View File

@ -33,6 +33,7 @@ class OnionrCommunicatorDaemon:
self.powSalt = 0
self.delay = 1
self.proxyPort = sys.argv[2]
self.startTime = self._core._utils.getEpoch()
self.onlinePeers = []
self.offlinePeers = []
@ -223,6 +224,7 @@ class OnionrCommunicatorDaemon:
tried.append(address)
logger.debug('failed to connect to ' + address)
else:
if len(self.onlinePeers) == 0:
logger.warn('Could not connect to any peer')
return retData
@ -253,7 +255,8 @@ class OnionrCommunicatorDaemon:
def heartbeat(self):
'''Show a heartbeat debug message'''
logger.debug('Communicator heartbeat')
currentTime = self._core._utils.getEpoch() - self.startTime
logger.debug('heartbeat, running seconds: ' + str(currentTime))
self.decrementThreadCount('heartbeat')
def daemonCommands(self):