mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Initialize mailer only if enabled
This commit is contained in:
parent
61b2c1e5c7
commit
6ccccaa373
|
|
@ -47,10 +47,13 @@ func NewInternalAPI(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Panicf("failed to connect to threepid db")
|
logrus.WithError(err).Panicf("failed to connect to threepid db")
|
||||||
}
|
}
|
||||||
mailer, err := mail.NewMailer(cfg)
|
var mailer mail.Mailer
|
||||||
|
if cfg.Email.Enabled {
|
||||||
|
mailer, err = mail.NewMailer(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Panicf("failed to crate Mailer")
|
logrus.WithError(err).Panicf("failed to crate Mailer")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return &internal.UserInternalAPI{
|
return &internal.UserInternalAPI{
|
||||||
AccountDB: accountDB,
|
AccountDB: accountDB,
|
||||||
DeviceDB: deviceDB,
|
DeviceDB: deviceDB,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue