我的客户端中的每个线程都使用
self.credentials = oauth2client.client.SignedJwtAssertionCredentials(...)
http = httplib2.Http()
http = self.credentials.authorize(http)
self.http = http这在一开始工作得很好,每个客户端都能做适当的工作。
随着时间的临近和令牌即将到期,刷新凭据的最佳方式是什么,以便每个线程都能继续取得进展?我试过了
self.credentials.refresh(self.http)就在那个小时之前,但我正在看
在_read_status raise BadStatusLine (行)BadStatusLine中,文件"/usr/lib64/python2.6/httplib.py",第355行
发布于 2013-09-23 19:07:33
关于线程,请阅读以下内容:https://developers.google.com/api-client-library/python/guide/thread_safety
不需要手动刷新,因为它是在apiclient库(here)中自动完成的。
代码如下所示:
{共享代码}
self.credentials = oauth2client.client.SignedJwtAssertionCredentials(...)。
{线程代码}
service = self.credentials.authorize(httplib2.Http())希望能有所帮助。
https://stackoverflow.com/questions/18827538
复制相似问题