gpt4 book ai didi

google-app-engine - Google Calendar api - 超出速率限制(即使不是)

转载 作者:太空宇宙 更新时间:2023-11-03 15:37:38 25 4
gpt4 key购买 nike

我有一个可与各种 Google API 配合使用的 App Engine 应用程序。我启动了一个同步任务,将 3000 个事件同步到各种用户日历。它工作了一段时间,但现在我收到以下错误:

PHP Fatal error:  Uncaught exception 'Google_Service_Exception' with message '{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "rateLimitExceeded",
"message": "Rate Limit Exceeded"
}
],
"code": 403,
"message": "Rate Limit Exceeded"
}
}

如果我查看 Api 仪表板,限制真的很高:

每天查询 1,000,000
每个用户每 100 秒的查询数 50,000,000。

我怎样才能克服这个错误?我希望完成此任务,以便用户在他们的日历中看到事件。

最佳答案

documentaion 中所述用户速率限制是防洪。应用程序每秒只能发出 X 次请求。

403: Rate Limit Exceeded The per-user limit from the Developer Console has been reached.

    {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "rateLimitExceeded",
"message": "Rate Limit Exceeded"
}
],
"code": 403,
"message": "Rate Limit Exceeded"
}
}

建议的操作:

使用exponential backoff .

您可以尝试添加配额用户,这有时会有所帮助。

quotaUser An arbitrary string that uniquely identifies a user.
Lets you enforce per-user quotas from a server-side application even in cases when the user's IP address is unknown. This can occur, for example, with applications that run cron jobs on App Engine on a user's behalf. You can choose any arbitrary string that uniquely identifies a user, but it is limited to 40 characters.

如果您收到配额错误,那么即使您认为没有超出配额,它也已超出。无法增加应用程序级别配额。你唯一能做的就是放慢速度。

关于google-app-engine - Google Calendar api - 超出速率限制(即使不是),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48146757/

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