mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
retry pgloader up to 5x (#1845)
This commit is contained in:
@@ -100,7 +100,14 @@ impl RpcContextConfig {
|
||||
.with_kind(crate::ErrorKind::Database)?;
|
||||
let old_db_path = self.datadir().join("main/secrets.db");
|
||||
if tokio::fs::metadata(&old_db_path).await.is_ok() {
|
||||
pgloader(&old_db_path).await?;
|
||||
let mut res = Ok(());
|
||||
for _ in 0..5 {
|
||||
res = pgloader(&old_db_path).await;
|
||||
if res.is_ok() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
res?
|
||||
}
|
||||
Ok(secret_store)
|
||||
}
|
||||
|
||||
@@ -141,7 +141,14 @@ impl SetupContext {
|
||||
.with_kind(crate::ErrorKind::Database)?;
|
||||
let old_db_path = self.datadir.join("main/secrets.db");
|
||||
if tokio::fs::metadata(&old_db_path).await.is_ok() {
|
||||
pgloader(&old_db_path).await?;
|
||||
let mut res = Ok(());
|
||||
for _ in 0..5 {
|
||||
res = pgloader(&old_db_path).await;
|
||||
if res.is_ok() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
res?
|
||||
}
|
||||
Ok(secret_store)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user