Skip to content

Skip dispatching endpoint/location tasks when lists are empty#14361

Merged
Maffooch merged 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:skip-empty-endpoint-location-tasks
Feb 23, 2026
Merged

Skip dispatching endpoint/location tasks when lists are empty#14361
Maffooch merged 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:skip-empty-endpoint-location-tasks

Conversation

@valentijnscholten
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten commented Feb 21, 2026

Summary

  • Add early return in chunk_endpoints_and_disperse and chunk_locations_and_disperse when the endpoint/location list is empty
  • Previously, one Celery task was dispatched per finding regardless.
  • This optimization avoids unnecessary task creation, serialization, and execution

Some Pro unit tests may need updated counts for any asserts on celery task counts.

Add early return in chunk_endpoints_and_disperse and chunk_locations_and_disperse
when the endpoint/location list is empty. Many parsers (e.g. Bandit) set file_path
but leave unsaved_endpoints/unsaved_locations empty, causing ~214 no-op Celery
tasks per import. This optimization avoids unnecessary task creation, serialization,
and execution.
@valentijnscholten valentijnscholten added this to the 2.55.4 milestone Feb 21, 2026
@valentijnscholten valentijnscholten marked this pull request as ready for review February 21, 2026 19:37
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Maffooch Maffooch merged commit f67196c into DefectDojo:bugfix Feb 23, 2026
147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants