diff options
author | kolaente <konrad@kola-entertainments.de> | 2019-06-12 21:41:28 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-06-12 15:41:28 -0400 |
commit | f9ec2f89f2265bc1371a6c62359de9816534fa6b (patch) | |
tree | f48b138a457e5ac6cf843bbb38400926704370f7 /modules/mailer | |
parent | 5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff) | |
download | gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip |
Add golangci (#6418)
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 411d6eafd8..d19ae7b2f4 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -258,15 +258,12 @@ func (s *dummySender) Send(from string, to []string, msg io.WriterTo) error { } func processMailQueue() { - for { - select { - case msg := <-mailQueue: - log.Trace("New e-mail sending request %s: %s", msg.GetHeader("To"), msg.Info) - if err := gomail.Send(Sender, msg.Message); err != nil { - log.Error("Failed to send emails %s: %s - %v", msg.GetHeader("To"), msg.Info, err) - } else { - log.Trace("E-mails sent %s: %s", msg.GetHeader("To"), msg.Info) - } + for msg := range mailQueue { + log.Trace("New e-mail sending request %s: %s", msg.GetHeader("To"), msg.Info) + if err := gomail.Send(Sender, msg.Message); err != nil { + log.Error("Failed to send emails %s: %s - %v", msg.GetHeader("To"), msg.Info, err) + } else { + log.Trace("E-mails sent %s: %s", msg.GetHeader("To"), msg.Info) } } } |