MCPcopy
hub / github.com/openai/openai-python / _perform_refresh

Method _perform_refresh

src/openai/auth/_workload.py:228–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

226 self._cached_token_refresh_at_monotonic = None
227
228 def _perform_refresh(self) -> None:
229 token_data = self._fetch_token_from_exchange()
230 now = time.monotonic()
231 expires_in = token_data["expires_in"]
232
233 with self._lock:
234 self._cached_token = token_data["access_token"]
235 self._cached_token_expires_at_monotonic = now + expires_in
236 self._cached_token_refresh_at_monotonic = now + self._refresh_delay_seconds(expires_in)
237
238 def _fetch_token_from_exchange(self) -> dict[str, Any]:
239 subject_token = self._get_subject_token()

Callers 1

get_tokenMethod · 0.95

Calls 2

Tested by

no test coverage detected