简体   繁体   中英

How to handle the API call rate limit for Docusign in nodejs

如何处理nodejs中Docusign的API调用速率限制?我收到类似“超过每小时API调用的最大次数”之类的错误。

So, you hit your QPH (queries per hour) limit, right?

Well, there are two things you can do to minize that:

Throttling

When an application has a query limit per period of time, throttling is often a common strategy used.

Throttling revolves around distributing your requests over a period of time. So for example, if you have a 500 limit of requests per hour, you can throttle your application to do 250 requests in the first 30 minutes, and 250 after.

This way you avoid hitting the limit. If you have more requests, then you save them for the next hour.

Caching

Throttling is good because it gives you control over time. But sometimes, requests are similar, so similar in fact that you can just save the answer and use it for later.

Caching is also often used together with throttling, by saving the answers from old requests in your system, and re-using them, you effectively loose the need to make requests against the API, and you gain the ability to answer more user requests (provided you cached them before).

Sum up

There is no silver bullet to solve your problem. There is no simple line of code to do that. Instead, you have two methods that used together will minimize your problem and perhaps even eliminate it altogether if used correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM