Fix: pass only authorized http to build(), not credentials, so timeout applies to API calls
This commit is contained in:
@@ -53,8 +53,11 @@ def _actor_id():
|
|||||||
|
|
||||||
|
|
||||||
def _svc(api: str, version: str, creds: Credentials):
|
def _svc(api: str, version: str, creds: Credentials):
|
||||||
|
# Pass ONLY the authorized http (with timeout) — do NOT also pass credentials.
|
||||||
|
# When both http= and credentials= are given, google-api-python-client creates a
|
||||||
|
# new un-timed Http() from credentials for API calls, ignoring our timeout.
|
||||||
http = creds.authorize(httplib2.Http(timeout=_HTTP_TIMEOUT))
|
http = creds.authorize(httplib2.Http(timeout=_HTTP_TIMEOUT))
|
||||||
return build(api, version, http=http, credentials=creds, cache_discovery=False)
|
return build(api, version, http=http, cache_discovery=False)
|
||||||
|
|
||||||
|
|
||||||
@tool
|
@tool
|
||||||
|
|||||||
Reference in New Issue
Block a user