You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're seeing that refreshing tokens from outside of a GCP env is slow, often around 1 second for us. Because of this we'd like to get the refresh done in background outside of the get_token call. This is possible but awkward currently as there's no direct way for a consumer to trigger refresh other than to call get_token in the last 20 seconds of the token lifetime.
Ideally the library would offer a background refresh option, or if not that, the ability to force a refresh.
I can put together a PR for either of these approaches if this is something you're interested in.
The text was updated successfully, but these errors were encountered:
This sounds interesting! (Out of curiosity, who's "we"?) Would it be enough for your use case to spawn a task on any token requests that happen shortly before the expiration? That seems like the simplest approach to me.
We're seeing that refreshing tokens from outside of a GCP env is slow, often around 1 second for us. Because of this we'd like to get the refresh done in background outside of the
get_token
call. This is possible but awkward currently as there's no direct way for a consumer to trigger refresh other than to callget_token
in the last 20 seconds of the token lifetime.Ideally the library would offer a background refresh option, or if not that, the ability to force a refresh.
I can put together a PR for either of these approaches if this is something you're interested in.
The text was updated successfully, but these errors were encountered: