Skip to content
Snippets Groups Projects
Commit d875aaaa authored by Rawel's avatar Rawel
Browse files

updated documentation with added edge case for sequential heuristic

parent fd8cc884
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,10 @@ selected_heuristic = "vuldigger2"
def run_heuristic(mapping_chunk):
"""
Runs the heuristic on a chunk of mappings
:param mapping_chunk: A list of mappings
"""
print(f"PID {os.getpid()} Starting heuristic range")
db_repo = DBRepository()
config_codes = get_config_codes_list()
......@@ -64,7 +68,7 @@ def worker(queue_in):
def calculate_chunk_size(mappings, num_cores):
# Use the same implementation as multiprocessing.Pool to calculate chunk size
"""Uses the same implementation as multiprocessing.Pool to calculate chunk size"""
chunk_size, extra = divmod(len(mappings), num_cores * 4)
if extra:
chunk_size += 1
......
......@@ -46,6 +46,16 @@ def main():
confidence,
json.dumps(result_json),
)
else:
# If no VCCs are found, we still want to update the mapping to indicate that we have checked it
db_repo.update_vcc_fixing_commit(
mapping["mapping_id"],
mapping["cve_id"],
mapping["vcc_sha"],
mapping["fixing_config_code"],
False,
json.dumps({})
)
def init_heuristic(selected_heuristic, config_code):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment