Don't log error when SendEmailNotifications is set to false (#20007)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -1196,8 +1196,11 @@ func (s *Server) Start() error {
|
|||||||
if err := s.Store.Status().ResetAll(); err != nil {
|
if err := s.Store.Status().ResetAll(); err != nil {
|
||||||
mlog.Error("Error to reset the server status.", mlog.Err(err))
|
mlog.Error("Error to reset the server status.", mlog.Err(err))
|
||||||
}
|
}
|
||||||
if err := mail.TestConnection(s.MailServiceConfig()); err != nil {
|
|
||||||
mlog.Error("Mail server connection test is failed", mlog.Err(err))
|
if s.MailServiceConfig().SendEmailNotifications {
|
||||||
|
if err := mail.TestConnection(s.MailServiceConfig()); err != nil {
|
||||||
|
mlog.Error("Mail server connection test failed", mlog.Err(err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.FileBackend().TestConnection()
|
err := s.FileBackend().TestConnection()
|
||||||
|
|||||||
@@ -208,10 +208,6 @@ func NewSMTPClient(ctx context.Context, conn net.Conn, config *SMTPConfig) (*smt
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnection(config *SMTPConfig) error {
|
func TestConnection(config *SMTPConfig) error {
|
||||||
if !config.SendEmailNotifications {
|
|
||||||
return errors.New("SendEmailNotifications is not true")
|
|
||||||
}
|
|
||||||
|
|
||||||
conn, err := ConnectToSMTPServer(config)
|
conn, err := ConnectToSMTPServer(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "unable to connect")
|
return errors.Wrap(err, "unable to connect")
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user