0

我有以下已部署到 Heroku 的代码:

credentials = SignedJwtAssertionCredentials(
    settings.SERVICE_ACCOUNT, KEY,
    scope='https://www.googleapis.com/auth/bigquery')
self.http = credentials.authorize(httplib2.Http())
self.service = build('bigquery', 'v2', http=self.http)
self.job_runner = self.service.jobs()

在构建服务对象时,我经常会收到 AccessTokenRefreshError。在这些情况下,我将中止请求,并在稍后重试。但是,我有时会连续 10-15 次出现此错误。我能做些什么来避免这个错误吗?我可以以某种方式手动刷新令牌吗?我在运行查询时也遇到了这个错误。

4

1 回答 1

0

Just to start wrapping up this thread, I believe that using Memcache is the best way to store OAuth2 authorization credential information that is accessible to all in a instances in a Heroku Dyno.

于 2012-11-08T23:00:23.300 回答