Other: setMailServerSettings is async as it should.

This commit is contained in:
Xavier Michelon
2022-11-29 13:31:12 +01:00
parent 7533dc952d
commit 2cce1c7b2a

View File

@ -640,6 +640,9 @@ func (s *Service) SetMailServerSettings(_ context.Context, settings *ImapSmtpSet
WithField("UseSSLForSMTP", settings.UseSSLForSmtp).
Debug("SetConnectionMode")
go func() {
defer s.panicHandler.HandlePanic()
defer func() { _ = s.SendEvent(NewChangeMailServerSettingsFinishedEvent()) }()
if s.bridge.GetIMAPSSL() != settings.UseSSLForImap {
@ -671,6 +674,7 @@ func (s *Service) SetMailServerSettings(_ context.Context, settings *ImapSmtpSet
}
_ = s.SendEvent(NewMailServerSettingsChangedEvent(s.getMailServerSettings()))
}()
return &emptypb.Empty{}, nil
}