mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Merge branch 'master' into flub/ongoing-guard
This commit is contained in:
@@ -91,7 +91,7 @@ pub async fn imex(
|
||||
let ongoing_guard = context.alloc_ongoing().await?;
|
||||
|
||||
let res = {
|
||||
let _guard = context.scheduler.pause(context.clone()).await;
|
||||
let _guard = context.scheduler.pause(context.clone()).await?;
|
||||
imex_inner(context, what, path, passphrase)
|
||||
.race(async {
|
||||
ongoing_guard.await;
|
||||
@@ -396,8 +396,7 @@ async fn imex_inner(
|
||||
export_backup(context, path, passphrase.unwrap_or_default()).await
|
||||
}
|
||||
ImexMode::ImportBackup => {
|
||||
import_backup(context, path, passphrase.unwrap_or_default()).await?;
|
||||
context.sql.run_migrations(context).await
|
||||
import_backup(context, path, passphrase.unwrap_or_default()).await
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,6 +472,7 @@ async fn import_backup(
|
||||
}
|
||||
}
|
||||
|
||||
context.sql.run_migrations(context).await?;
|
||||
delete_and_reset_all_device_msgs(context).await?;
|
||||
|
||||
Ok(())
|
||||
@@ -758,7 +758,7 @@ async fn export_database(context: &Context, dest: &Path, passphrase: String) ->
|
||||
.with_context(|| format!("path {} is not valid unicode", dest.display()))?;
|
||||
|
||||
context.sql.set_raw_config_int("backup_time", now).await?;
|
||||
sql::housekeeping(context).await.ok_or_log(context);
|
||||
sql::housekeeping(context).await.log_err(context).ok();
|
||||
context
|
||||
.sql
|
||||
.call_write(|conn| {
|
||||
|
||||
Reference in New Issue
Block a user