Skip to content

Commit

Permalink
Paginate the usernames to avoid posible exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed May 16, 2024
1 parent 228caa4 commit acd9569
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ protected override async Task<IEnumerable<IUser>> GetUsersAsync(WorkflowExecutio

if (userNames.Length > 0)
{
return await _session.Query<User, UserIndex>(user => user.NormalizedUserName.IsIn(userNames)).ListAsync();
var users = new List<User>();

foreach (var page in userNames.PagesOf(1000))
{
users.AddRange(await _session.Query<User, UserIndex>(user => user.NormalizedUserName.IsIn(page)).ListAsync());
}

return users;
}
}

Expand Down

0 comments on commit acd9569

Please sign in to comment.