Skip to content

Commit 3731761

Browse files
committed
Make pipeline progress step configurable
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 0205d18 commit 3731761

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vulnerabilities/pipelines/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ class VulnerableCodeBaseImporterPipelineV2(VulnerableCodePipeline):
266266
repo_url = None
267267
ignorable_versions = []
268268

269+
# Control how often progress log is shown (range: 1–100, higher value = less frequent log)
270+
progress_step = 10
271+
269272
# When set to true pipeline is run only once.
270273
# To rerun onetime pipeline reset is_active field to True via migration.
271274
run_once = False
@@ -301,7 +304,11 @@ def collect_and_store_advisories(self):
301304
if estimated_advisory_count > 0:
302305
self.log(f"Collecting {estimated_advisory_count:,d} advisories")
303306

304-
progress = LoopProgress(total_iterations=estimated_advisory_count, logger=self.log)
307+
progress = LoopProgress(
308+
total_iterations=estimated_advisory_count,
309+
logger=self.log,
310+
progress_step=self.progress_step,
311+
)
305312
for advisory in progress.iter(self.collect_advisories()):
306313
if advisory is None:
307314
self.log("Advisory is None, skipping")

0 commit comments

Comments
 (0)