2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

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

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;