diff --git a/cloud-util/src/graceful_shutdown.rs b/cloud-util/src/graceful_shutdown.rs index ededf75..8b12c82 100644 --- a/cloud-util/src/graceful_shutdown.rs +++ b/cloud-util/src/graceful_shutdown.rs @@ -32,8 +32,8 @@ pub fn graceful_shutdown() -> flume::Receiver<()> { tokio::spawn(async move { if let Ok(exit_type) = rx_exit.recv_async().await { match exit_type { - ExitType::Signal(_) => info!("exit by: {exit_type:?}"), - ExitType::Panic => eprintln!("exit by: {exit_type:?}"), + ExitType::Signal(signal_n) => info!("exit by: signal {}!", signal_n), + ExitType::Panic => eprintln!("exit by: panic!"), } drop(tx); } diff --git a/cloud-util/src/wal.rs b/cloud-util/src/wal.rs index 14083b6..51ae824 100644 --- a/cloud-util/src/wal.rs +++ b/cloud-util/src/wal.rs @@ -80,6 +80,7 @@ impl Wal { let mut ifs = OpenOptions::new() .read(true) .create(true) + .truncate(true) .write(true) .open(file_path) .await?; @@ -119,6 +120,7 @@ impl Wal { let fs = OpenOptions::new() .read(true) .create(true) + .truncate(true) .write(true) .open(last_file_path) .await?; @@ -197,6 +199,7 @@ impl Wal { .read(true) .write(true) .create(true) + .truncate(true) .open(filename) .await?; entry.insert(fs);