appengine-gcs-client icon indicating copy to clipboard operation
appengine-gcs-client copied to clipboard

storage_api: Avoid OverQuotaError from get_service_account_name

Open evanj opened this issue 9 years ago • 1 comments

Commit 10e7febf00 assigned app_identity.get_service_account_name to a local variable, outside of the if statement. This means it gets called every time this function is called, which makes an RPC on App Engine. During periods of high activity, this can exceed the per-minute API quota and raise OverQuotaError.

To fix this, only call this if local_run() is True, which should only happen in development and never in App Engine production.

evanj avatar Oct 26 '16 18:10 evanj

I just found a bug in this change, a year and a half later! This tweak makes this work with both unit tests and dev_appserver.py

evanj avatar Mar 20 '18 19:03 evanj