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

feat: notifications and preferences will be created in batches #33418

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

muhammadadeeltajamul
Copy link
Contributor

Optimized creation of notifications and notification preferences

  • Notifications will be created in batches
  • Notification Preferences will be created in batches
  • Batch size default size is 99
  • Optimized query count when getting updated preferences
  • At the time of notification creation, preferences will not be created if default is False
  • Added Test cases

Ticket Link: INF-1076

notifications_generated = Notification.objects.bulk_create(notifications)
audience.append(preference.user_id)
# send notification to users but use bulk_create
notification_objects = Notification.objects.bulk_create(notifications, batch_size=batch_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: batch_size has no impact here because user_ids is already batched.

@muhammadadeeltajamul muhammadadeeltajamul merged commit 29c83ca into master Oct 6, 2023
62 checks passed
@muhammadadeeltajamul muhammadadeeltajamul deleted the inf-1076 branch October 6, 2023 11:27
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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.

4 participants