MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / getPriorityBoost

Method getPriorityBoost

src/Worker/WorkerManager.py:438–458  ·  view source on GitHub ↗
(self, inner_path)

Source from the content-addressed store, hash-verified

436
437 # Tasks sorted by this
438 def getPriorityBoost(self, inner_path):
439 if inner_path == "content.json":
440 return 9999 # Content.json always priority
441 if inner_path == "index.html":
442 return 9998 # index.html also important
443 if "-default" in inner_path:
444 return -4 # Default files are cloning not important
445 elif inner_path.endswith("all.css"):
446 return 14 # boost css files priority
447 elif inner_path.endswith("all.js"):
448 return 13 # boost js files priority
449 elif inner_path.endswith("dbschema.json"):
450 return 12 # boost database specification
451 elif inner_path.endswith("content.json"):
452 return 1 # boost included content.json files priority a bit
453 elif inner_path.endswith(".json"):
454 if len(inner_path) < 50: # Boost non-user json files
455 return 11
456 else:
457 return 2
458 return 0
459
460 # Create new task and return asyncresult
461 def addTask(self, inner_path, peer=None, priority=0, file_info=None):

Callers 1

addTaskMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected