summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mailer')
-rw-r--r--modules/mailer/mailer.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index eafe04680a..e1c453a22e 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -197,7 +197,10 @@ func processMailQueue() {
var mailQueue chan *Message
func NewContext() {
- if setting.MailService == nil {
+ // Need to check if mailQueue is nil because in during reinstall (user had installed
+ // before but swithed install lock off), this function will be called again
+ // while mail queue is already processing tasks, and produces a race condition.
+ if setting.MailService == nil || mailQueue != nil {
return
}