Rev2060, Only boost all.js and all.css priority, really fix download priority test
This commit is contained in:
parent
d2cf613872
commit
bf042ce7a3
3 changed files with 6 additions and 6 deletions
|
@ -10,7 +10,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.5.4"
|
||||
self.rev = 2059
|
||||
self.rev = 2060
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.config_file = "zeronet.conf"
|
||||
|
|
|
@ -42,9 +42,9 @@ class TestSiteDownload:
|
|||
file_requests = [request[2]["inner_path"] for request in requests if request[0] in ("getFile", "streamFile")]
|
||||
# Test priority
|
||||
assert file_requests[0:2] == ["content.json", "index.html"] # Must-have files
|
||||
assert file_requests[2:4] == ["css/all.css", "js/all.js"] # Important assets
|
||||
assert file_requests[4] == "dbschema.json" # Database map
|
||||
assert file_requests[5:7] == ["data/img/multiuser.png", "data/img/direct_domains.png"] # Directly requested files
|
||||
assert file_requests[2:4] == ["data/img/multiuser.png", "data/img/direct_domains.png"] # Directly requested files
|
||||
assert file_requests[4:6] == ["css/all.css", "js/all.js"] # Important assets
|
||||
assert file_requests[6] == "dbschema.json" # Database map
|
||||
assert "-default" in file_requests[-1] # Put default files for cloning to the end
|
||||
|
||||
# Check files
|
||||
|
|
|
@ -390,9 +390,9 @@ class WorkerManager(object):
|
|||
return 9998 # index.html also important
|
||||
if "-default" in inner_path:
|
||||
return -4 # Default files are cloning not important
|
||||
elif inner_path.endswith(".css"):
|
||||
elif inner_path.endswith("all.css"):
|
||||
return 13 # boost css files priority
|
||||
elif inner_path.endswith(".js"):
|
||||
elif inner_path.endswith("all.js"):
|
||||
return 12 # boost js files priority
|
||||
elif inner_path.endswith("dbschema.json"):
|
||||
return 11 # boost database specification
|
||||
|
|
Loading…
Reference in a new issue