mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
retry pgloader up to 5x (#1845)
This commit is contained in:
@@ -100,7 +100,14 @@ impl RpcContextConfig {
|
|||||||
.with_kind(crate::ErrorKind::Database)?;
|
.with_kind(crate::ErrorKind::Database)?;
|
||||||
let old_db_path = self.datadir().join("main/secrets.db");
|
let old_db_path = self.datadir().join("main/secrets.db");
|
||||||
if tokio::fs::metadata(&old_db_path).await.is_ok() {
|
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)
|
Ok(secret_store)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,14 @@ impl SetupContext {
|
|||||||
.with_kind(crate::ErrorKind::Database)?;
|
.with_kind(crate::ErrorKind::Database)?;
|
||||||
let old_db_path = self.datadir.join("main/secrets.db");
|
let old_db_path = self.datadir.join("main/secrets.db");
|
||||||
if tokio::fs::metadata(&old_db_path).await.is_ok() {
|
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)
|
Ok(secret_store)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": null,
|
"name": null,
|
||||||
"auto-check-updates": true,
|
"auto-check-updates": true,
|
||||||
"pkg-order": [],
|
"pkg-order": [],
|
||||||
"ack-welcome": "0.3.0",
|
"ack-welcome": "0.3.2",
|
||||||
"marketplace": {
|
"marketplace": {
|
||||||
"selected-id": null,
|
"selected-id": null,
|
||||||
"known-hosts": {}
|
"known-hosts": {}
|
||||||
|
|||||||
Reference in New Issue
Block a user