Rev903, FeedQuery command only available for ADMIN sites, Show bad files in sidebar, Log unknown messages, Add and check inner_path and site address on sign/verify, Better peer cleanup limit, Log site load times, Testcase for address and inner_path verification, Re-sign testsite with new fields, Fix unnecessary loading screen display when browsing sub-folder with index.html, Fix safari notification width
This commit is contained in:
parent
4885d2be79
commit
1dbc33445f
20 changed files with 218 additions and 123 deletions
|
@ -777,7 +777,7 @@ class Site(object):
|
|||
if time.time() - peer.time_found > 60 * 60 * 4: # Not found on tracker or via pex in last 4 hour
|
||||
peer.remove()
|
||||
removed += 1
|
||||
if removed > 5: # Don't remove too much at once
|
||||
if removed > len(peers)*0.1: # Don't remove too much at once
|
||||
break
|
||||
|
||||
if removed:
|
||||
|
|
|
@ -2,6 +2,7 @@ import json
|
|||
import logging
|
||||
import re
|
||||
import os
|
||||
import time
|
||||
|
||||
from Plugin import PluginManager
|
||||
from Config import config
|
||||
|
@ -23,7 +24,9 @@ class SiteManager(object):
|
|||
# Load new adresses
|
||||
for address in json.load(open("%s/sites.json" % config.data_dir)):
|
||||
if address not in self.sites and os.path.isfile("%s/%s/content.json" % (config.data_dir, address)):
|
||||
s = time.time()
|
||||
self.sites[address] = Site(address)
|
||||
logging.debug("Loaded site %s in %.3fs" % (address, time.time()-s))
|
||||
added += 1
|
||||
address_found.append(address)
|
||||
|
||||
|
@ -77,8 +80,8 @@ class SiteManager(object):
|
|||
|
||||
# Lazy load sites
|
||||
def list(self):
|
||||
logging.debug("Loading sites...")
|
||||
if self.sites is None: # Not loaded yet
|
||||
logging.debug("Loading sites...")
|
||||
self.load()
|
||||
return self.sites
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue