retry file copies during migration (#1221)

* retry file copies during migration up to 10x

* fix build

* readonly mounts, and validation on v2 recovery

* banish booleans
This commit is contained in:
Aiden McClelland
2022-02-16 17:33:08 -07:00
committed by GitHub
parent 4a69b1138d
commit c443ab1419
15 changed files with 178 additions and 72 deletions

View File

@@ -10,7 +10,6 @@ use rpc_toolkit::command;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use tokio::io::AsyncWriteExt;
use tokio::sync::oneshot::Sender;
use torut::onion::TorSecretKeyV3;
use tracing::instrument;
@@ -21,6 +20,7 @@ use crate::backup::{BackupReport, ServerBackupReport};
use crate::context::RpcContext;
use crate::db::util::WithRevision;
use crate::disk::mount::backup::BackupMountGuard;
use crate::disk::mount::filesystem::ReadWrite;
use crate::disk::mount::guard::TmpMountGuard;
use crate::notifications::NotificationLevel;
use crate::s9pk::manifest::PackageId;
@@ -126,7 +126,7 @@ pub async fn backup_all(
.load(&mut ctx.secret_store.acquire().await?)
.await?;
let mut backup_guard = BackupMountGuard::mount(
TmpMountGuard::mount(&fs).await?,
TmpMountGuard::mount(&fs, ReadWrite).await?,
old_password.as_ref().unwrap_or(&password),
)
.await?;