fix(GODT-2774): Add external context to telemetry tasks

This ensures they get cancelled if the parent context becomes invalid
This commit is contained in:
Leander Beernaert
2023-07-06 12:00:19 +02:00
parent 1c2cb4f439
commit 40c48ba804
18 changed files with 67 additions and 58 deletions

View File

@ -76,7 +76,7 @@ func newIMAPConnector(user *User, addrID string) *imapConnector {
}
// Authorize returns whether the given username/password combination are valid for this connector.
func (conn *imapConnector) Authorize(username string, password []byte) bool {
func (conn *imapConnector) Authorize(ctx context.Context, username string, password []byte) bool {
addrID, err := conn.CheckAuth(username, password)
if err != nil {
return false
@ -86,7 +86,7 @@ func (conn *imapConnector) Authorize(username string, password []byte) bool {
return false
}
conn.User.SendConfigStatusSuccess()
conn.User.SendConfigStatusSuccess(ctx)
return true
}