Auth: Pass ctx when updating last seen (#88496)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
@@ -158,6 +158,7 @@ func (s *UserSync) SyncLastSeenHook(ctx context.Context, identity *authn.Identit
|
||||
return nil
|
||||
}
|
||||
|
||||
goCtx := context.WithoutCancel(ctx)
|
||||
go func(userID int64) {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
@@ -165,7 +166,7 @@ func (s *UserSync) SyncLastSeenHook(ctx context.Context, identity *authn.Identit
|
||||
}
|
||||
}()
|
||||
|
||||
if err := s.userService.UpdateLastSeenAt(context.Background(),
|
||||
if err := s.userService.UpdateLastSeenAt(goCtx,
|
||||
&user.UpdateUserLastSeenAtCommand{UserID: userID, OrgID: r.OrgID}); err != nil &&
|
||||
!errors.Is(err, user.ErrLastSeenUpToDate) {
|
||||
s.log.Error("Failed to update last_seen_at", "err", err, "userId", userID)
|
||||
|
||||
Reference in New Issue
Block a user