aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-02-20 17:32:34 -0500
committerUnknwon <u@gogs.io>2016-02-20 17:32:34 -0500
commit926e75d72126be97f9974976abfb46449a53f3c6 (patch)
tree58aeea38dd9d4979e4d6646aa0fff4dd10dc178a /modules/mailer
parentd5a3021a7d86a6dbf42df97c5c25e22b0b3f9505 (diff)
downloadgitea-926e75d72126be97f9974976abfb46449a53f3c6.tar.gz
gitea-926e75d72126be97f9974976abfb46449a53f3c6.zip
#2334 strip whitespace for migrate URL
Also fix a possible race condition while install
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
}