diff --git a/src/Test/TestSiteDownload.py b/src/Test/TestSiteDownload.py index 9b20b6f2..146e835e 100644 --- a/src/Test/TestSiteDownload.py +++ b/src/Test/TestSiteDownload.py @@ -35,16 +35,16 @@ class TestSiteDownload: def boostRequest(inner_path): # I really want these file if inner_path == "index.html": - site_temp.needFile("data/img/multiuser.png", priority=9, blocking=False) - site_temp.needFile("data/img/direct_domains.png", priority=10, blocking=False) + site_temp.needFile("data/img/multiuser.png", priority=5, blocking=False) + site_temp.needFile("data/img/direct_domains.png", priority=5, blocking=False) site_temp.onFileDone.append(boostRequest) site_temp.download(blind_includes=True).join(timeout=5) 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] == ["data/img/direct_domains.png", "data/img/multiuser.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 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 "-default" in file_requests[-1] # Put default files for cloning to the end # Check files diff --git a/src/Worker/WorkerManager.py b/src/Worker/WorkerManager.py index 8fc97971..dffd524e 100644 --- a/src/Worker/WorkerManager.py +++ b/src/Worker/WorkerManager.py @@ -384,15 +384,18 @@ class WorkerManager(object): if "-default" in inner_path: return -4 # Default files are cloning not important elif inner_path.endswith(".css"): - return 5 # boost css files priority + return 7 # boost css files priority elif inner_path.endswith(".js"): - return 4 # boost js files priority + return 6 # boost js files priority elif inner_path.endswith("dbschema.json"): - return 3 # boost database specification + return 5 # boost database specification elif inner_path.endswith("content.json"): return 1 # boost included content.json files priority a bit elif inner_path.endswith(".json"): - return 2 # boost data json files priority more + if len(inner_path) < 50: # Boost non-user json files more + return 4 + else: + return 2 return 0 # Create new task and return asyncresult