mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Log more
This commit is contained in:
28
src/imex.rs
28
src/imex.rs
@@ -123,7 +123,7 @@ async fn cleanup_aborted_imex(context: &Context, what: ImexMode) {
|
|||||||
.sql
|
.sql
|
||||||
.open(context, context.get_dbfile(), false)
|
.open(context, context.get_dbfile(), false)
|
||||||
.await
|
.await
|
||||||
.ok();
|
.map_err(|e| warn!(context, "Re-opening db after imex failed: {}", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,17 +171,23 @@ pub async fn has_backup_old(context: &Context, dir_name: impl AsRef<Path>) -> Re
|
|||||||
let name = name.to_string_lossy();
|
let name = name.to_string_lossy();
|
||||||
if name.starts_with("delta-chat") && name.ends_with(".bak") {
|
if name.starts_with("delta-chat") && name.ends_with(".bak") {
|
||||||
let sql = Sql::new();
|
let sql = Sql::new();
|
||||||
if sql.open(context, &path, true).await.is_ok() {
|
match sql.open(context, &path, true).await {
|
||||||
let curr_backup_time = sql
|
Ok(_) => {
|
||||||
.get_raw_config_int(context, "backup_time")
|
let curr_backup_time = sql
|
||||||
.await
|
.get_raw_config_int(context, "backup_time")
|
||||||
.unwrap_or_default();
|
.await
|
||||||
if curr_backup_time > newest_backup_time {
|
.unwrap_or_default();
|
||||||
newest_backup_path = Some(path);
|
if curr_backup_time > newest_backup_time {
|
||||||
newest_backup_time = curr_backup_time;
|
newest_backup_path = Some(path);
|
||||||
|
newest_backup_time = curr_backup_time;
|
||||||
|
}
|
||||||
|
info!(context, "backup_time of {} is {}", name, curr_backup_time);
|
||||||
|
sql.close().await;
|
||||||
}
|
}
|
||||||
info!(context, "backup_time of {} is {}", name, curr_backup_time);
|
Err(e) => warn!(
|
||||||
sql.close().await;
|
context,
|
||||||
|
"Found backup file {} which could not be opened: {}", name, e
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ impl Sql {
|
|||||||
// drop closes the connection
|
// drop closes the connection
|
||||||
}
|
}
|
||||||
|
|
||||||
// return true on success, false on failure
|
|
||||||
pub async fn open<T: AsRef<Path>>(
|
pub async fn open<T: AsRef<Path>>(
|
||||||
&self,
|
&self,
|
||||||
context: &Context,
|
context: &Context,
|
||||||
|
|||||||
Reference in New Issue
Block a user