Give 10 second timeout for reannounce

This commit is contained in:
shortcutme 2018-10-30 04:43:58 +01:00
parent f05c7ffbfa
commit 8c76e258d7
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -330,6 +330,14 @@ class FileServer(ConnectionServer):
startup = False startup = False
time.sleep(60 * 20) time.sleep(60 * 20)
def announceSite(self, site):
site.announce(mode="update", pex=False)
active_site = time.time() - site.settings.get("modified", 0) < 24 * 60 * 60
if site.settings["own"] or active_site: # Check connections more frequently on own and active sites to speed-up first connections
site.needConnections(check_site_on_reconnect=True)
site.sendMyHashfield(3)
site.updateHashfield(3)
# Announce sites every 20 min # Announce sites every 20 min
def announceSites(self): def announceSites(self):
time.sleep(5 * 60) # Sites already announced on startup time.sleep(5 * 60) # Sites already announced on startup