Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bom update log not working for large batch size #34715

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def queue_bom_cost_jobs(

while current_boms_list:
batch_no += 1
batch_size = 20_000
batch_size = 7_000
boms_to_process = current_boms_list[:batch_size] # slice out batch of 20k BOMs

# update list to exclude 20K (queued) BOMs
Expand Down Expand Up @@ -212,7 +212,7 @@ def resume_bom_cost_update_jobs():
["name", "boms_updated", "status"],
)
incomplete_level = any(row.get("status") == "Pending" for row in bom_batches)
if not bom_batches or not incomplete_level:
if not bom_batches or incomplete_level:
continue

# Prep parent BOMs & updated processed BOMs for next level
Expand Down Expand Up @@ -252,9 +252,6 @@ def get_processed_current_boms(
current_boms = []

for row in bom_batches:
if not row.boms_updated:
continue

boms_updated = json.loads(row.boms_updated)
current_boms.extend(boms_updated)
boms_updated_dict = {bom: True for bom in boms_updated}
Expand Down