Allow less peer error if for popular sites

This commit is contained in:
shortcutme 2017-06-19 16:13:06 +02:00
parent 066f54f521
commit 916709a7e4
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -329,7 +329,11 @@ class Peer(object):
# On connection error
def onConnectionError(self, reason="Unknown"):
self.connection_error += 1
if self.connection_error >= 6: # Dead peer
if len(self.site.peers) > 200:
limit = 3
else:
limit = 6
if self.connection_error >= limit: # Dead peer
self.remove("Peer connection: %s" % reason)
# Done working with peer