mirror of
https://git.asonix.dog/asonix/pict-rs.git
synced 2024-11-28 12:31:00 +00:00
Run health checks on old and new stores before migrating
This commit is contained in:
parent
198b594142
commit
d51c348a3f
1 changed files with 12 additions and 1 deletions
13
src/lib.rs
13
src/lib.rs
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue