Microsoft Graph节流Excel更新 [英] Microsoft Graph throttling Excel updates

查看:65
本文介绍了Microsoft Graph节流Excel更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个连接到Microsoft Graph API的Node.js应用程序.

I am developing a Node.js app which connects to the Microsoft Graph API.

通常,我会返回一个429状态代码,在错误文档.

Often times, I get back a 429 status code, which is described as "Too Many Requests" in the error documentation.

有时返回的消息是:

TooManyRequests.客户端应用程序已被限制,在经过一定时间之前,不应尝试重复该请求.

TooManyRequests. Client application has been throttled and should not attempt to repeat the request until an amount of time has elapsed.

其他时间,它返回:

"TooManyRequests.服务器正忙.请稍后再试.".

"TooManyRequests. The server is busy. Please try again later.".

不幸的是,即使它们的

Unfortunately, it is not returning a Retry-After field in the headers, even though their best practices claims that it should do so.

这完全是在开发中,并且我对服务的期望不高,因为调试期间就一直如此.我意识到Microsoft经常在改变它的工作方式.我只是发现很难围绕甚至没有提供Retry-After字段的服务来开发应用程序,而且似乎存在很多问题(我正在使用v1.0端点).

This is entirely in development, and I have not been hitting the service much, as it has all been during debugging. I realize Microsoft is often changing how this works. I just find it difficult to develop an app around a service which does not even provide a Retry-After field, and seems to have a lot of problems (I am using the v1.0 endpoint).

当我等待5分钟(如我所看到的建议)时,该服务仍然出错.这是一个示例返回响应:

When I wait 5 minutes (as I have seen recommended), the service still errors out. Here is an example return response:

{
    "error": {
        "code": "TooManyRequests",
        "message": "The server is busy. Please try again later.",
        "innerError": {
            "request-id": "d963bb00-6bdf-4d6b-87f9-973ef00de211",
            "date": "2017-08-31T23:09:32"
        }
    }
}

这完全与正在进行的操作有关吗?

Could this relate at all to the operation being carried out?

我正在更新A2:L3533的范围.它们都是文本值.我想知道这是否会影响节流.我尚未找到有关使用较小"操作集的任何指导.

I am updating a range from A2:L3533. They are all text values. I am wondering if this could impact the throttling. I have not found any guidance regarding using "smaller" operation sets.

推荐答案

没有看到您的代码,很难准确地诊断出正在发生的事情.就是说,您是Range,这里是巨大的,几乎可以肯定会导致问题.

Without seeing your code, it is hard to diagnose exactly what is going on. That said, you're Range here is enormous and almost certainly will result in issues.

来自文档:

大范围"表示一个范围的大小对于单个API调用而言太大.范围中包含的许多因素(例如单元格数量,值,numberFormat和公式)会使响应如此之大,以至于不适合进行API交互. API会尽最大努力返回或写入请求的数据.但是,由于资源利用率高,涉及的大尺寸可能会导致API错误情况.

Large Range implies a Range of a size that is too large for a single API call. Many factors such as number of cells, values, numberFormat, and formulas contained in the range can make the response so large that it becomes unsuitable for API interaction. The API makes a best attempt to return or write to the requested data. However, the large size involved might result in an API error condition because of the large resource utilization.

为避免这种情况,建议您以多个较小的范围大小读取或写入较大的范围.

To avoid this, we recommend that you read or write for large Range in multiple smaller range sizes.

这篇关于Microsoft Graph节流Excel更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆