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

Method _needs_refresh

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

Source from the content-addressed store, hash-verified

299 return time.monotonic() >= self._cached_token_expires_at_monotonic
300
301 def _needs_refresh(self) -> bool:
302 if self._cached_token_refresh_at_monotonic is None:
303 return False
304 return time.monotonic() >= self._cached_token_refresh_at_monotonic
305
306 def _refresh_delay_seconds(self, expires_in: float) -> float:
307 configured_buffer = self.workload_identity.get("refresh_buffer_seconds", DEFAULT_REFRESH_BUFFER_SECONDS)

Callers 1

get_tokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected