mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LDAP: Fix active sync with large quantities of users (#73834)
This commit is contained in:
parent
4ce8fff98a
commit
9e52414a91
@ -3,6 +3,7 @@ package sync
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/authn"
|
||||
@ -234,7 +235,7 @@ func (s *UserSync) updateUserAttributes(ctx context.Context, usr *user.User, id
|
||||
}
|
||||
|
||||
if needsUpdate {
|
||||
s.log.FromContext(ctx).Debug("Syncing user info", "id", id.ID, "update", updateCmd)
|
||||
s.log.FromContext(ctx).Debug("Syncing user info", "id", id.ID, "update", fmt.Sprintf("%v", updateCmd))
|
||||
if err := s.userService.Update(ctx, updateCmd); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -288,8 +288,8 @@ func (server *Server) Users(logins []string) (
|
||||
) {
|
||||
var users [][]*ldap.Entry
|
||||
err := getUsersIteration(logins, func(previous, current int) error {
|
||||
var err error
|
||||
users, err = server.users(logins[previous:current])
|
||||
iterationUsers, err := server.users(logins[previous:current])
|
||||
users = append(users, iterationUsers...)
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user