From c85491cc71abe820da4f79b80b2c2d5ecd866b7e Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:08:33 -0600 Subject: [PATCH] ignore file not found error for delete (#1822) --- backend/src/init.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/init.rs b/backend/src/init.rs index abeb0877f..fad3909d4 100644 --- a/backend/src/init.rs +++ b/backend/src/init.rs @@ -324,7 +324,11 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { crate::version::init(&mut handle, &receipts).await?; if should_rebuild { - tokio::fs::remove_file(SYSTEM_REBUILD_PATH).await?; + match tokio::fs::remove_file(SYSTEM_REBUILD_PATH).await { + Ok(()) => Ok(()), + Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), + Err(e) => Err(e), + }?; } tracing::info!("System initialized.");