How to wait for limits in GetUsersFromId

Feb 28, 2015 at 7:07 PM
Hi,

I use
 IEnumerable<long> BloccoIE = UtentiId as IEnumerable<long>;
 IEnumerable<IUser> BloccoUtenti = Tweetinvi.User.GetUsersFromIds(BloccoIE);
and it works, I can query multiple times 100 ids each time and then save the results.

The problem is that after a while (I suppose when I reach the limit) I get an exception on this code that is before my query
TwitterCredentials.ExecuteOperationWithCredentials(cred, () =>
{
   var user = User.GetLoggedUser(cred);
(user is null)


the overall structure of my code is
while true
    Get 100 ids from my db
    ExecuteOperationWithCredentials
        GetUsersFromId
        save users on db
loop

Maybe I must insert an await
Coordinator
Mar 2, 2015 at 9:35 AM
Hi,

Yes you do. Here is the documentation for rate limits https://tweetinvi.codeplex.com/documentation#RateLimits.
// If you are happy to let Tweetinvi wait for the RateLimit to be available, here is how you can do.
RateLimit.UseRateLimitAwaiter = true;
Linvi
Marked as answer by linvi on 3/10/2015 at 3:19 AM