Skip to content

Conversation

@bodintsov
Copy link
Contributor

Ticket

Purpose

Optimize subscription population scripts

Changes

Optimize subscription population scripts

Side Effects

TBD

QE Notes

TBD

CE Notes

TBD

Documentation

TBD

Comment on lines +55 to +59
NotificationSubscription.objects.bulk_create(
items_to_create,
batch_size=batch_size,
ignore_conflicts=True,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a exception catch to log the error and continue the for loop.

)
total_created += len(items_to_create)

print(f"Created {total_created} subscriptions.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a timing to track how long it takes, for each batch and/or for the total.

@cslzchen cslzchen marked this pull request as draft January 20, 2026 14:51
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.

2 participants