From 7299e9f92ee74ff38827a0e30acfe6953d69190e Mon Sep 17 00:00:00 2001 From: Ivan Fraixedes Date: Tue, 16 Aug 2022 13:20:18 +0200 Subject: [PATCH] satellite/console: Add missing monkit calls Add monkit monitoring calls to a couple of the service's methods because they were missed. Change-Id: I327a79634b7cdcaeb0e2701a737bb714a6478c4a --- satellite/console/service.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/satellite/console/service.go b/satellite/console/service.go index 66bc91903..ed7925483 100644 --- a/satellite/console/service.go +++ b/satellite/console/service.go @@ -527,7 +527,6 @@ func (payment Payments) TokenDeposit(ctx context.Context, amount int64) (_ *paym } tx, err := payment.service.accounts.StorjTokens().Deposit(ctx, user.ID, amount) - if err != nil { return nil, Error.Wrap(err) } @@ -797,7 +796,9 @@ func (s *Service) GeneratePasswordRecoveryToken(ctx context.Context, id uuid.UUI } // GenerateSessionToken creates a new session and returns the string representation of its token. -func (s *Service) GenerateSessionToken(ctx context.Context, userID uuid.UUID, email, ip, userAgent string) (consoleauth.Token, error) { +func (s *Service) GenerateSessionToken(ctx context.Context, userID uuid.UUID, email, ip, userAgent string) (_ consoleauth.Token, err error) { + defer mon.Task()(&ctx)(&err) + sessionID, err := uuid.New() if err != nil { return consoleauth.Token{}, Error.Wrap(err) @@ -1129,7 +1130,9 @@ func (s *Service) Token(ctx context.Context, request AuthUser) (token consoleaut } // UpdateUsersFailedLoginState updates User's failed login state. -func (s *Service) UpdateUsersFailedLoginState(ctx context.Context, user *User) error { +func (s *Service) UpdateUsersFailedLoginState(ctx context.Context, user *User) (err error) { + defer mon.Task()(&ctx)(&err) + updateRequest := UpdateUserRequest{} if user.FailedLoginCount >= s.config.LoginAttemptsWithoutPenalty-1 { lockoutDuration := time.Duration(math.Pow(s.config.FailedLoginPenalty, float64(user.FailedLoginCount-1))) * time.Minute