-
Notifications
You must be signed in to change notification settings - Fork 355
[ENG-10071] Feature/optimize subscription population script #11560
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
base: feature/notifications-refactor-post-release
Are you sure you want to change the base?
Conversation
| ) | ||
| total_created += len(items_to_create) | ||
|
|
||
| print(f"Created {total_created} subscriptions.") |
There was a problem hiding this comment.
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.
| total_created = 0 | ||
|
|
||
| for count, user in enumerate(user_qs, 1): | ||
| batch_start = datetime.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move batch_start out of the for loop and reset it after each batch process.
| print(f'Error during bulk_create: {e}') | ||
| finally: | ||
| items_to_create.clear() | ||
| batch_end = datetime.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, batch_end should be inside the if block for processing each batch.
Ticket
Purpose
Optimize subscription population scripts
Changes
Optimize subscription population scripts
Side Effects
TBD
QE Notes
TBD
CE Notes
TBD
Documentation
TBD