mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 18:02:56 +00:00
review: move FlushHandle::handle_error right after ::flush
Signed-off-by: Yuchen Liang <yuchen@neon.tech>
This commit is contained in:
@@ -175,6 +175,13 @@ where
|
||||
Ok((recycled, flush_control))
|
||||
}
|
||||
|
||||
async fn handle_error<T>(&mut self) -> std::io::Result<T> {
|
||||
Err(self
|
||||
.shutdown()
|
||||
.await
|
||||
.expect_err("flush task only disconnects duplex if it exits with an error"))
|
||||
}
|
||||
|
||||
/// Cleans up the channel, join the flush task.
|
||||
pub async fn shutdown(&mut self) -> std::io::Result<Arc<W>> {
|
||||
let handle = self
|
||||
@@ -192,10 +199,6 @@ where
|
||||
.as_mut()
|
||||
.expect("must not use after we returned an error")
|
||||
}
|
||||
|
||||
async fn handle_error<T>(&mut self) -> std::io::Result<T> {
|
||||
Err(self.shutdown().await.expect_err("flush task only disconnects duplex if it exits with an error"))
|
||||
}
|
||||
}
|
||||
|
||||
/// A background task for flushing data to disk.
|
||||
|
||||
Reference in New Issue
Block a user