mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Box the managed credential loading future (#62568)
Return a pinned, boxed future from `try_load_managed_auth` so callers store a pointer to the credential loading future in their async state machines instead of embedding the full future. GitOrigin-RevId: 898e4877cc197720d88fc36a566533c5594f4f38
This commit is contained in:
@@ -3118,7 +3118,15 @@ impl AuthManager {
|
||||
.map_err(RefreshTokenError::Transient)
|
||||
}
|
||||
|
||||
async fn try_load_managed_auth(
|
||||
// Keep managed credential loading out of each caller's async state machine.
|
||||
fn try_load_managed_auth<'a>(
|
||||
&'a self,
|
||||
cached_auth: Option<&'a CodexAuth>,
|
||||
) -> Pin<Box<dyn Future<Output = std::io::Result<Option<CodexAuth>>> + Send + 'a>> {
|
||||
Box::pin(self.try_load_managed_auth_impl(cached_auth))
|
||||
}
|
||||
|
||||
async fn try_load_managed_auth_impl(
|
||||
&self,
|
||||
cached_auth: Option<&CodexAuth>,
|
||||
) -> std::io::Result<Option<CodexAuth>> {
|
||||
|
||||
Reference in New Issue
Block a user