You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using your tool to throttle orders from Amazon. Here are the parameters:
//Loop through them calling GetOrder, since GetOrder has a max request quota of 6 with a refill rate of 1 a minute, with the added benefit of being able to call up to 50 orders per request. This means that I can make an initial request for 300 orders, then I must throttle down to 1 request a minute, requiring an additional 14 minutes for the remaining 700 orders.
//For each order, I must call ListOrderItems. This has a max request limit of 30 and a restore rate of 1 every 2 seconds. This means that I can initially make 30 requests, then I must throttle to 1 every 2 seconds, which means it would take me about 485 seconds (or 8 minutes) to finish getting the order items for the rest of the orders.
Here is my code:
listOrderRequestBucket = new FixedTokenBucket(6, 60, 1000);
listOrderItemsRequestBucket = new FixedTokenBucket(1, 2, 1000);
listFinancialEventsResponseBucket = new FixedTokenBucket(1, 2, 1000);
When I am throttled, I do this:
Timespan WaitTime;
bool shouldThrottle = listOrderRequestBucket.ShouldThrottle(1, out waitTime);
if (shouldThrottle)
{
Thread.Sleep(waitTime);
listOrderRequestBucket = new FixedTokenBucket(1, 60, 1000);
}
Is this what you recommend?
The text was updated successfully, but these errors were encountered:
Hi,
I am using your tool to throttle orders from Amazon. Here are the parameters:
Here is my code:
When I am throttled, I do this:
Is this what you recommend?
The text was updated successfully, but these errors were encountered: