mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
simplify names
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -70,8 +70,12 @@ func (m Message) Content() string {
|
||||
|
||||
var mailQueue chan *Message
|
||||
|
||||
func NewMailerContext() {
|
||||
mailQueue = make(chan *Message, setting.Cfg.Section("mailer").Key("SEND_BUFFER_LEN").MustInt(10))
|
||||
func NewContext() {
|
||||
if setting.MailService == nil {
|
||||
return
|
||||
}
|
||||
|
||||
mailQueue = make(chan *Message, setting.MailService.QueueLength)
|
||||
go processMailQueue()
|
||||
}
|
||||
|
||||
|
@@ -229,9 +229,9 @@ func forcePathSeparator(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
// NewConfigContext initializes configuration context.
|
||||
// NewContext initializes configuration context.
|
||||
// NOTE: do not print any log except error.
|
||||
func NewConfigContext() {
|
||||
func NewContext() {
|
||||
workDir, err := WorkDir()
|
||||
if err != nil {
|
||||
log.Fatal(4, "Fail to get work directory: %v", err)
|
||||
@@ -545,6 +545,7 @@ func newSessionService() {
|
||||
|
||||
// Mailer represents mail service.
|
||||
type Mailer struct {
|
||||
QueueLength int
|
||||
Name string
|
||||
Host string
|
||||
From string
|
||||
@@ -581,6 +582,7 @@ func newMailService() {
|
||||
}
|
||||
|
||||
MailService = &Mailer{
|
||||
QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
|
||||
Name: sec.Key("NAME").MustString(AppName),
|
||||
Host: sec.Key("HOST").String(),
|
||||
User: sec.Key("USER").String(),
|
||||
|
Reference in New Issue
Block a user