Run health checks on old and new stores before migrating

This commit is contained in:
asonix 2023-07-07 14:05:13 -05:00
parent 198b594142
commit d51c348a3f
1 changed files with 12 additions and 1 deletions

View File

@ -1483,7 +1483,18 @@ where
S2: Store + Clone, S2: Store + Clone,
R: IdentifierRepo + HashRepo + SettingsRepo + QueueRepo, R: IdentifierRepo + HashRepo + SettingsRepo + QueueRepo,
{ {
tracing::warn!("Migrating store"); tracing::warn!("Running checks");
if let Err(e) = from.health_check().await {
tracing::warn!("Old store is not configured correctly");
return Err(e.into());
}
if let Err(e) = to.health_check().await {
tracing::warn!("New store is not configured correctly");
return Err(e.into());
}
tracing::warn!("Checks complete, migrating store");
let mut failure_count = 0; let mut failure_count = 0;