mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 00:10:15 +00:00
Rewrite delivery of issue and comment mails (#9009)
* Mail issue subscribers, rework the function * Simplify a little more * Fix unused variable * Refactor mail delivery to avoid heavy load on server * Avoid splitting into too many goroutines * Fix comments and optimize GetMaileableUsersByIDs() * Fix return on errors
This commit is contained in:
parent
9ff6312627
commit
08ae6bb7ed
10 changed files with 254 additions and 148 deletions
|
@ -295,9 +295,18 @@ func NewContext() {
|
|||
go processMailQueue()
|
||||
}
|
||||
|
||||
// SendAsync send mail asynchronous
|
||||
// SendAsync send mail asynchronously
|
||||
func SendAsync(msg *Message) {
|
||||
go func() {
|
||||
mailQueue <- msg
|
||||
}()
|
||||
}
|
||||
|
||||
// SendAsyncs send mails asynchronously
|
||||
func SendAsyncs(msgs []*Message) {
|
||||
go func() {
|
||||
for _, msg := range msgs {
|
||||
mailQueue <- msg
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue