gpt4 book ai didi

Facebook 工作场所合规性集成 - 错误代码 960

转载 作者:行者123 更新时间:2023-12-04 03:08:22 26 4
gpt4 key购买 nike

我正在使用 Python 和 Facebook Graph API 编写合规性集成,以在我们的 Workplace 社区中搜索所有用户内容的给定关键字。我有一些以前每次都有效的东西,但是最近(过去几天)发送到 Facebook 的请求之一将返回错误代码 960 的 FacebookApiException,并显示消息“请求中止。如果依赖请求失败,可能会发生这种情况或者整个请求超时。”在已经成功收到数以千计的成功请求之后。这种情况不会一直发生,但通常会失败。

{
"error": {
"message": "Request aborted. This could happen if a dependent request failed or the entire request timed out.",
"code": 960,
"type": "FacebookApiException",
"fbtrace_id": "B72L8jiCFZy"
}
}

为了简单起见,我没有在我的请求中使用依赖项,所以我只能认为它超时了。我的问题是——Facebook Graph API 的超时期限是多少?超时是因为我发送请求的时间太长,还是因为 Facebook 服务器响应我的请求的时间太长?有什么办法可以增加超时来阻止错误消息的发生?

TIA

最佳答案

这个问题比较老,但以防其他人正在寻找答案。

我无法回答 Facebook Graph Api 的超时期限是多少,但我可以为那些遇到超时错误的人指出一个解决方法。

Facebook 有关于如何处理超时的文档: https://developers.facebook.com/docs/graph-api/making-multiple-requests/#timeouts

Large or complex batches may timeout if it takes too long to complete all the requests within the batch. In such a circumstance, the result is a partially-completed batch. In partially-completed batches, responses from operations that complete successfully will look normal (see prior examples) whereas responses for operations that are not completed will be null.

The ordering of responses correspond with the ordering of operations in the request, so developers should process responses accordingly to determine which operations were successful and which should be retried in a subsequent operation.

因此,根据他们的文档,超时的批处理请求的响应应如下所示:

[
{ "code": 200,
"headers": [
{ "name":"Content-Type",
"value":"text/javascript; charset=UTF-8"}
],
"body":"{\"id\":\"…\"}"
},
null,null,null
]

使用他们的示例,您应该只需要将批处理请求数组中与空响应相对应的项目重新排队。

关于Facebook 工作场所合规性集成 - 错误代码 960,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47054865/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com