How to wait for limits in GetUsersFromId

Feb 28, 2015 at 7:07 PM

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
        save users on db

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

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