Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dojo/importers/default_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def process_findings(
parsed_findings: list[Finding],
**kwargs: dict,
) -> list[Finding]:
sync_requested = kwargs.get("sync", True)
# Progressive batching for chord execution
post_processing_task_signatures = []
current_batch_number = 1
Expand Down Expand Up @@ -253,7 +254,7 @@ def process_findings(
post_processing_task_signatures.append(post_processing_task_signature)

# Check if we should launch a chord (batch full or end of findings)
if we_want_async(async_user=self.user) and post_processing_task_signatures:
if we_want_async(async_user=self.user, sync=sync_requested) and post_processing_task_signatures:
post_processing_task_signatures, current_batch_number, _ = self.maybe_launch_post_processing_chord(
post_processing_task_signatures,
current_batch_number,
Expand Down Expand Up @@ -283,8 +284,7 @@ def process_findings(
# Always perform an initial grading, even though it might get overwritten later.
perform_product_grading(self.test.engagement.product)

sync = kwargs.get("sync", True)
if not sync:
if not sync_requested:
return [serialize("json", [finding]) for finding in new_findings]
return new_findings

Expand Down
5 changes: 2 additions & 3 deletions dojo/importers/default_reimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def process_findings(
the finding may be appended to a new or existing group based upon user selection
at import time
"""
sync_requested = kwargs.get("sync", True)
self.deduplication_algorithm = self.determine_deduplication_algorithm()
# Only process findings with the same service value (or None)
# Even though the service values is used in the hash_code calculation,
Expand Down Expand Up @@ -271,7 +272,7 @@ def process_findings(
post_processing_task_signatures.append(post_processing_task_signature)

# Check if we should launch a chord (batch full or end of findings)
if we_want_async(async_user=self.user) and post_processing_task_signatures:
if we_want_async(async_user=self.user, sync=sync_requested) and post_processing_task_signatures:
post_processing_task_signatures, current_batch_number, _ = self.maybe_launch_post_processing_chord(
post_processing_task_signatures,
current_batch_number,
Expand Down Expand Up @@ -772,6 +773,4 @@ def calculate_unsaved_finding_hash_code(
self,
unsaved_finding: Finding,
) -> str:
# this is overridden in Pro, but will still call this via super()
deduplicationLogger.debug("Calculating hash code for unsaved finding")
return unsaved_finding.compute_hash_code()
Loading