OVER_QUERY_LIMIT in a loop

别说谁变了你拦得住时间么 提交于 2019-12-10 19:16:28

问题


I'm getting the OVER_QUERY_LIMIT status code when using the Google Places Javascript Library. I have billing enabled on my account so it's not that I'm actually hitting the limit on the number of places requests I make, but I'm using the Javascript library and looping through a few hundred Places search requests. The problem is, this causes OVER_QUERY_LIMIT status to come back from the search unless, while debugging, I slow down the loop.

Funnily enough this only happens with the JS Library, not when using the API directly. Rather than putting something in to slow the loop, is there anything that people can recommend to fix this?

EDIT: More info on the two scenarios

  1. (the problem) Loops through dozens of points, each time making a places request through the official Places Javascript API
  2. (the one which works) Using node.js on the backend to make requests directly to the places search endpoint documented at https://developers.google.com/maps/documentation/places/ and then pushing individual responses to the client.

Thanks, Dan

来源:https://stackoverflow.com/questions/10409141/over-query-limit-in-a-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!