Fix: pass only authorized http to build(), not credentials, so timeout applies to API calls

This commit is contained in:
daniel
2026-05-08 11:17:38 -05:00
parent 350ce231a4
commit f4444cbd22

View File

@@ -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