简体   繁体   English

如果达到谷歌日历 usageLimit 或 rateLimit,有什么方法可以知道 waitTime

[英]Is there any way to know the waitTime if Google calendar usageLimit or rateLimit is reached

I am working on developing integration with Google Calendar using Rest API. I got to know Google applies both rateLimit and usageLimit on API calls - 403_calendar_usage_limits_exceeded我正在使用 Rest API 开发与 Google 日历的集成。我知道 Google 在 API 调用上同时应用了 rateLimit 和 usageLimit - 403_calendar_usage_limits_exceeded

In case I breach the limits, I want to wait for a defined period of time before I retry the request again.万一我违反了限制,我想等待一段定义的时间,然后再重试请求。 Is there any way to know if there is something like Retry-After header returned by Google.有什么办法可以知道谷歌是否返回了Retry-After header 之类的东西。

I checked documentation but not able to find anything related - errors我检查了文档但找不到任何相关的内容 -错误

You can see your quota in google developer console under libary search for google calendar and then click the manage button.您可以在谷歌开发者控制台的 libary search for google calendar 下查看您的配额,然后单击管理按钮。 Under the quota tab you will see something like this.在配额选项卡下,您会看到类似这样的内容。

在此处输入图像描述

There are two types of quota user based quota denoted by the "per user" and project based quotas.有两种类型的配额基于用户的配额表示为“每用户”和基于项目的配额。

Each user running my application can make a max of 600 requests per minute.每个运行我的应用程序的用户每分钟最多可以发出 600 个请求。 if they make to many then i will get a quota exception.如果他们做了很多,那么我将获得配额例外。

My application can make a max of 10000 request per minute in total.我的应用程序每分钟最多可以发出 10000 个请求。 if it makes more then that then again i will get a quota exception.如果它赚得更多,那么我将再次获得配额例外。

You may want to read though Manage quotas this explains a lot about quota usage and the google calendar api.您可能想阅读管理配额这解释了很多关于配额使用和谷歌日历 api 的内容。

For the most part if you just implement exponential backoff you should be able to avoid to many of these errors.在大多数情况下,如果您只是实施指数退避,您应该能够避免其中的许多错误。

  1. try request if fails如果失败尝试请求
  2. wait 10 seconds等待 10 秒
  3. try again if fails如果失败再试
  4. wait 20 seconds等待 20 秒
  5. try again if fails如果失败再试
  6. wait 30 seconds等待 30 秒
  7. try again.......再试一次.......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当用户在谷歌日历事件中提出新时间时,他们有什么办法可以通过 API 知道这一点吗? - When user propose new time in google calendar events is their any way to know that via API? 有没有办法在Google日历和iOS日历中使用URL字段 - Is there any way to use a URL field across google calendar and ios calendar 有什么方法可以进一步自定义嵌入式Google日历? - Any Way to Further Customize Embedded Google Calendar? 有什么方法可以设置谷歌日历,使邀请来自别名吗? - Is there any way to set up google calendar such that invites come from an alias? 有没有办法从 android 应用程序中删除谷歌日历中的事件 - Is there any way to delete events from google calendar from android application 有没有办法修改从外部应用程序在Google日历中创建的事件? - Is there any way to modify an event created at Google Calendar from external app? 在没有 token.pickle 的情况下创建新的 Google 日历事件的任何方法 - Any way to create a new Google Calendar event without token.pickle 有没有人知道任何与从Rails应用程序向iCal,Google Calendar,Outlook导出事件相关的宝石/插件/教程? - Does anyone know any gems/plugins/tutorials related to exporting events to iCal, Google Calendar, Outlook from a Rails application? 有没有一种可以分发Google日历小工具的方法? - Is there a way to distribute Google Calendar gadgets? 是iphone sdk的谷歌日历api吗? - Is any google calendar api for iphone sdk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM