Skip to content

Commit

Permalink
Deliver scheduled emails one by one
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBednarik committed Jan 31, 2022
1 parent 0213b81 commit d51b6fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zerver/management/commands/deliver_scheduled_emails.py
Expand Up @@ -48,7 +48,7 @@ def handle(self, *args: Any, **options: Any) -> None:
email_jobs_to_deliver = (
ScheduledEmail.objects.filter(scheduled_timestamp__lte=timezone_now())
.prefetch_related("users")
.select_for_update()
.select_for_update()[:1]
)
if email_jobs_to_deliver:
found_rows = True
Expand Down

0 comments on commit d51b6fc

Please sign in to comment.