Fix non handled error

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-09 08:29:47 +01:00
parent 4875a2bd5e
commit 68d7e4f7a2

View File

@@ -336,7 +336,10 @@ func (w *SendingWorker) sendMail(ctx context.Context, to []string, msg []byte) e
}
if deadline, ok := ctx.Deadline(); ok {
conn.SetDeadline(deadline)
if err := conn.SetDeadline(deadline); err != nil {
_ = conn.Close()
return fmt.Errorf("cannot set connection deadline: %w", err)
}
}
c, err := smtp.NewClient(conn, host)