Allow less peer error if for popular sites
This commit is contained in:
parent
066f54f521
commit
916709a7e4
1 changed files with 5 additions and 1 deletions
|
@ -329,7 +329,11 @@ class Peer(object):
|
||||||
# On connection error
|
# On connection error
|
||||||
def onConnectionError(self, reason="Unknown"):
|
def onConnectionError(self, reason="Unknown"):
|
||||||
self.connection_error += 1
|
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)
|
self.remove("Peer connection: %s" % reason)
|
||||||
|
|
||||||
# Done working with peer
|
# Done working with peer
|
||||||
|
|
Loading…
Reference in a new issue