Configuration is broken for some reason… i’m trying to update a batch of 500 users in Genesys Cloud using the .NET SDK and i’m hitting a wall with rate limiting. the code loops through a list of users and calls UsersApi.PutUserAsync for each one. it works fine for the first 20 or so, then suddenly everything crashes with a 429 Too Many Requests error. i’ve read that there’s a rate limit of 100 requests per second for most endpoints, but i’m not sure how to handle this in .NET without freezing the whole process. i tried adding a simple Thread.Sleep(1000) between calls, but that takes way too long for 500 users. is there a better way to implement exponential backoff or check the Retry-After header in the response? here’s the basic loop i’m using:
foreach (var user in usersToUpdate)
{
try
{
await usersApi.PutUserAsync(user.Id, user);
}
catch (ApiException ex)
{
Console.WriteLine($"Error updating user {user.Id}: {ex.Message}");
if (ex.ErrorCode == 429)
{
// what do i put here?
}
}
}
any ideas on how to fix this? i’m stuck.