mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Box the session startup cleanup future (#63333)
## What changed Return a `BoxFuture<'_, ()>` from `SessionStartup::cleanup` and move the teardown logic into the private async `cleanup_inner` method. Callers continue to await `cleanup()` at the same points. GitOrigin-RevId: 5c263027fb93d64f1872f4f3d5b732df4b4427e5
This commit is contained in:
@@ -62,7 +62,11 @@ impl SessionStartup {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn cleanup(&self) {
|
||||
pub(crate) fn cleanup(&self) -> BoxFuture<'_, ()> {
|
||||
Box::pin(self.cleanup_inner())
|
||||
}
|
||||
|
||||
async fn cleanup_inner(&self) {
|
||||
let mut teardown = self.lock_teardown().take();
|
||||
if let Some(teardown) = teardown.as_mut()
|
||||
&& let Some(session) = self.session.get()
|
||||
|
||||
Reference in New Issue
Block a user