Skip to content

Commit

Permalink
skip over errors when migrating archive indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jul 31, 2023
1 parent 7684e8c commit 2f5bcda
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use self::sqlite_pool::SqliteConnectionPool;
use crate::error::Result;
use crate::web::metrics::RenderingTimesRecorder;
use crate::{db::Pool, Config, InstanceMetrics};
use anyhow::{anyhow, ensure, Context as _};
use anyhow::{anyhow, ensure};
use chrono::{DateTime, Utc};
use path_slash::PathExt;
use postgres::fallible_iterator::FallibleIterator;
Expand All @@ -28,7 +28,7 @@ use std::{
sync::Arc,
};
use tokio::runtime::Runtime;
use tracing::{info, instrument, trace};
use tracing::{error, info, instrument, trace};

const MAX_CONCURRENT_UPLOADS: usize = 1000;

Expand Down Expand Up @@ -643,10 +643,12 @@ pub fn migrate_old_archive_indexes(
let version: &str = row.get(1);
info!("converting archive index for {} {}...", name, version);

migrate_one(storage, &rustdoc_archive_path(name, version))
.context("error converting rustdoc archive index")?;
migrate_one(storage, &source_archive_path(name, version))
.context("error converting source archive index")?;
if let Err(err) = migrate_one(storage, &rustdoc_archive_path(name, version)) {
error!("error converting rustdoc archive index: {:?}", err);
}
if let Err(err) = migrate_one(storage, &source_archive_path(name, version)) {
error!("error converting source archive index: {:?}", err);
}
}
Ok(())
}
Expand Down

0 comments on commit 2f5bcda

Please sign in to comment.