Commit f67196c
authored
Skip dispatching endpoint/location tasks when lists are empty (#14361)
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.1 parent 8161bc2 commit f67196c
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
0 commit comments