fix(mail): pass mail server timeout (#1253)

Fix error log for mailserver closing logic, as default timeout of 15 seconds of mail client package used triggers before our logic leading to error on close.

Resolves https://github.com/go-vikunja/api/issues/48

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/1253
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Luca Bernstein <luca@lucabernstein.com>
Co-committed-by: Luca Bernstein <luca@lucabernstein.com>
This commit is contained in:
Luca Bernstein 2022-09-26 16:09:39 +00:00 committed by konrad
parent 2e3603507c
commit 25609db567

View file

@ -55,6 +55,7 @@ func getClient() (*mail.Client, error) {
InsecureSkipVerify: config.MailerSkipTLSVerify.GetBool(),
ServerName: config.MailerHost.GetString(),
}),
mail.WithTimeout((config.MailerQueueTimeout.GetDuration() + 3) * time.Second), // 3s more for us to close before mail server timeout
}
if config.MailerUsername.GetString() != "" && config.MailerPassword.GetString() != "" {