Files
mostlymatter/app/email
Agniva De Sarker 346fab1620 MM-50393: Revamp email batching performance (#22358)
This ticket does a number of improvements to the email
batching code in general.

- Fix unbounded goroutines: We now send mails using a single
goroutine only. Since anyways the processing is asynchronous,
performance should not matter.
- Move the exit condition earlier: We have moved up the check
for the per-user email interval preference. This prevents
unnecessary DB calls from happening.
- Break from the loop properly: The objective was to not
send notifications if a user has viewed any channel since
a notification was queued. But there were 2 nested for loops
and we were breaking from just one and not the other. That is
correctly fixed now to prevent unnecessary DB calls.
- Gracefully shutdown the job: The batching task wasn't
properly shut down and could have notifications in-flight
which would have not got sent. We fix that now by cancelling
the task and waiting for it to finish.

https://mattermost.atlassian.net/browse/MM-50393
2023-03-08 08:42:21 +05:30
..
2021-08-17 16:08:04 -04:00