Don't keep connections for sites that not modified in last week
This commit is contained in:
parent
4afb6b3d9c
commit
d44677e46f
1 changed files with 6 additions and 3 deletions
|
@ -274,7 +274,10 @@ class FileServer(ConnectionServer):
|
|||
site.retryBadFiles()
|
||||
|
||||
if not startup: # Don't do it at start up because checkSite already has needConnections at start up.
|
||||
connected_num = site.needConnections(check_site_on_reconnect=True) # Keep active peer connection to get the updates
|
||||
if time.time() - site.settings.get("modified") < 60 * 60 * 24 * 7:
|
||||
# Keep active connections if site has been modified witin 7 days
|
||||
connected_num = site.needConnections(check_site_on_reconnect=True)
|
||||
|
||||
if connected_num < config.connected_limit: # This site has small amount of peers, protect them from closing
|
||||
peers_protected.update([peer.key for peer in site.getConnectedPeers()])
|
||||
|
||||
|
|
Loading…
Reference in a new issue