ignore missing package archive on 035 migration

This commit is contained in:
Aiden McClelland
2026-01-21 15:58:46 -07:00
parent 3333416331
commit 0534b5813b

View File

@@ -277,7 +277,12 @@ impl VersionT for Version {
/// MUST be idempotent, and is run after *all* db migrations
async fn post_up(self, ctx: &RpcContext, input: Value) -> Result<(), Error> {
let path = Path::new(formatcp!("{PACKAGE_DATA}/archive/"));
if !path.is_dir() {
let metadata = tokio::fs::metadata(path).await;
if metadata.is_err() {
// Treat non-existent archive directory as empty
return Ok(());
}
if !metadata.unwrap().is_dir() {
return Err(Error::new(
eyre!(
"expected path ({}) to be a directory",