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:
Charlie Marsh
2026-11-23 12:55:29 +00:00
committed by copyberry
parent 1cf4ea68b8
commit 00315bb12a
+5 -1
View File
@@ -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()