Skip to content

Commit

Permalink
empty if exists
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Nov 28, 2024
1 parent 674112b commit 1ef154b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/risedevtool/src/task/meta_node_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ fn initialize_meta_store() -> Result<(), anyhow::Error> {
// SQLite in-memory database does not need initialization.
} else {
let filename = options.get_filename();
fs_err::write(filename, b"").context("failed to empty SQLite file")?;
if std::fs::exists(filename)? {
fs_err::write(filename, b"").context("failed to empty SQLite file")?;
}
}

return Ok(());
Expand Down

0 comments on commit 1ef154b

Please sign in to comment.