site connection stats, msgpack unpacker stats, make sure we dont skip any namecoin blocks, no more sha1 hash to content.json, keep 5 open connection in passive mode, publish got content to 5 peers, upnp retry 3 times, keep connection loggers
This commit is contained in:
parent
2491814070
commit
9c5176a8cb
7 changed files with 70 additions and 11 deletions
|
@ -101,6 +101,8 @@ class FileServer(ConnectionServer):
|
|||
if site.settings["serving"]:
|
||||
site.announce() # Announce site to tracker
|
||||
site.update() # Update site's content.json and download changed files
|
||||
if self.port_opened == False: # In passive mode keep 5 active peer connection to get the updates
|
||||
site.needConnections()
|
||||
|
||||
|
||||
# Check sites integrity
|
||||
|
@ -112,6 +114,7 @@ class FileServer(ConnectionServer):
|
|||
for address, site in self.sites.items(): # Check sites integrity
|
||||
gevent.spawn(self.checkSite, site) # Check in new thread
|
||||
time.sleep(2) # Prevent too quick request
|
||||
site = None
|
||||
|
||||
|
||||
# Announce sites every 20 min
|
||||
|
@ -121,10 +124,19 @@ class FileServer(ConnectionServer):
|
|||
for address, site in self.sites.items():
|
||||
if site.settings["serving"]:
|
||||
site.announce() # Announce site to tracker
|
||||
for inner_path in site.bad_files: # Reset bad file retry counter
|
||||
|
||||
# Reset bad file retry counter
|
||||
for inner_path in site.bad_files:
|
||||
site.bad_files[inner_path] = 0
|
||||
|
||||
# In passive mode keep 5 active peer connection to get the updates
|
||||
if self.port_opened == False:
|
||||
site.needConnections()
|
||||
|
||||
time.sleep(2) # Prevent too quick request
|
||||
|
||||
site = None
|
||||
|
||||
|
||||
# Detects if computer back from wakeup
|
||||
def wakeupWatcher(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue