mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
log file size on backup import
due to an bug from Apple copying files from/to iPhones (cmp. https://support.delta.chat/t/import-backup-to-ios/1628/7 ) it may easily happen that one gets corrupted/partly backups. such imports usually fail with some error, however, for debugging it is nice to have the concrete file size in the log.
This commit is contained in:
15
src/imex.rs
15
src/imex.rs
@@ -441,13 +441,6 @@ async fn import_backup(
|
||||
backup_to_import: &Path,
|
||||
passphrase: String,
|
||||
) -> Result<()> {
|
||||
info!(
|
||||
context,
|
||||
"Import \"{}\" to \"{}\".",
|
||||
backup_to_import.display(),
|
||||
context.get_dbfile().display()
|
||||
);
|
||||
|
||||
ensure!(
|
||||
!context.is_configured().await?,
|
||||
"Cannot import backups to accounts in use."
|
||||
@@ -459,6 +452,14 @@ async fn import_backup(
|
||||
|
||||
let backup_file = File::open(backup_to_import).await?;
|
||||
let file_size = backup_file.metadata().await?.len();
|
||||
info!(
|
||||
context,
|
||||
"Import \"{}\" ({} bytes) to \"{}\".",
|
||||
backup_to_import.display(),
|
||||
file_size,
|
||||
context.get_dbfile().display()
|
||||
);
|
||||
|
||||
let archive = Archive::new(backup_file);
|
||||
|
||||
let mut entries = archive.entries()?;
|
||||
|
||||
Reference in New Issue
Block a user