[英]Accessing Google AdWords data in parallel
Given 特定
I'm developing two different applications that utilize the same AdWords API access credentials. 我正在开发两个使用相同AdWords API访问凭据的不同应用程序。 Bot application are only intended to gather/analyse data from the API. Bot应用程序仅用于从API收集/分析数据。
Applications #1 and #2 take roughly 1 hour to complete the process of getting/analysing the data from API. #1和#2应用程序大约需要1个小时才能完成从API获取/分析数据的过程。
I'm using: 我正在使用:
The problem 问题
Sometimes both timesframes (for app #1 and #2) can overlap, and I start to get tons of these error: 有时两个时间段(对于应用程序1和应用程序2)可能会重叠,而我开始收到大量此类错误:
AdwordsApi::Errors::ReportXmlError: HTTP code: 400, error type: 'AuthorizationError.USER_PERMISSION_DENIED'
The next sequence of events leads to a problem: 下一个事件序列导致一个问题:
So the question is: is there a way to do such a setup to enable both applications accessing the AdWords API at the very same time without token interference/invalidation ? 因此,问题是: 是否可以进行这样的设置,以使两个应用程序同时访问AdWords API而不会造成令牌干扰/无效 ?
We have many apps which follow the same pattern as you have described but we don't experience token invalidations. 我们有许多应用程序遵循您所描述的相同模式,但是我们不会遇到令牌失效的情况。
AdwordsApi::Api.new(credentials).authorize
We cache the token that's returned there and then re-use it for subsequent requests, but the credentials we use are shared by many apps, the token is only used by one app. 我们缓存返回的令牌,然后将其用于后续请求,但我们使用的凭据由许多应用程序共享,令牌仅由一个应用程序使用。 We cache it for 12 hours then expire it, causing a new one to be issued. 我们将其缓存12个小时,然后将其过期,从而导致发布新的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.