mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
transform current_block to ok_to_continue
This commit is contained in:
committed by
holger krekel
parent
50947b81c0
commit
d7b0ecad75
@@ -712,7 +712,7 @@ The macro avoids weird values of 0% or 100% while still working. */
|
|||||||
// TODO should return bool /rtn
|
// TODO should return bool /rtn
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_int {
|
unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_int {
|
||||||
let mut current_block: u64;
|
let mut ok_to_continue: bool;
|
||||||
let mut success: libc::c_int = 0;
|
let mut success: libc::c_int = 0;
|
||||||
|
|
||||||
let mut delete_dest_file: libc::c_int = 0;
|
let mut delete_dest_file: libc::c_int = 0;
|
||||||
@@ -768,16 +768,14 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
/* error already logged */
|
/* error already logged */
|
||||||
current_block = 11487273724841241105;
|
ok_to_continue = false;
|
||||||
} else {
|
} else {
|
||||||
current_block = 14648156034262866959;
|
ok_to_continue = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 14648156034262866959;
|
ok_to_continue = true;
|
||||||
}
|
}
|
||||||
match current_block {
|
if ok_to_continue {
|
||||||
11487273724841241105 => {}
|
|
||||||
_ => {
|
|
||||||
let mut total_files_cnt = 0;
|
let mut total_files_cnt = 0;
|
||||||
let dir = std::path::Path::new(as_str(context.get_blobdir()));
|
let dir = std::path::Path::new(as_str(context.get_blobdir()));
|
||||||
if let Ok(dir_handle) = std::fs::read_dir(dir) {
|
if let Ok(dir_handle) = std::fs::read_dir(dir) {
|
||||||
@@ -793,7 +791,7 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
let mut processed_files_cnt = 0;
|
let mut processed_files_cnt = 0;
|
||||||
for entry in dir_handle {
|
for entry in dir_handle {
|
||||||
if entry.is_err() {
|
if entry.is_err() {
|
||||||
current_block = 2631791190359682872;
|
ok_to_continue = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let entry = entry.unwrap();
|
let entry = entry.unwrap();
|
||||||
@@ -805,7 +803,7 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
.shall_stop_ongoing
|
.shall_stop_ongoing
|
||||||
{
|
{
|
||||||
delete_dest_file = 1;
|
delete_dest_file = 1;
|
||||||
current_block = 11487273724841241105;
|
ok_to_continue = false;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
processed_files_cnt += 1;
|
processed_files_cnt += 1;
|
||||||
@@ -850,7 +848,7 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
&curr_pathNfilename,
|
&curr_pathNfilename,
|
||||||
);
|
);
|
||||||
/* this is not recoverable! writing to the sqlite database should work! */
|
/* this is not recoverable! writing to the sqlite database should work! */
|
||||||
current_block = 11487273724841241105;
|
ok_to_continue = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -872,11 +870,9 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info!(context, 0, "Backup: No files to copy.",);
|
info!(context, 0, "Backup: No files to copy.",);
|
||||||
current_block = 2631791190359682872;
|
ok_to_continue = true;
|
||||||
}
|
}
|
||||||
match current_block {
|
if ok_to_continue {
|
||||||
11487273724841241105 => {}
|
|
||||||
_ => {
|
|
||||||
if sql
|
if sql
|
||||||
.set_config_int(context, "backup_time", now as i32)
|
.set_config_int(context, "backup_time", now as i32)
|
||||||
.is_ok()
|
.is_ok()
|
||||||
@@ -888,7 +884,6 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
);
|
);
|
||||||
success = 1;
|
success = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error!(
|
error!(
|
||||||
@@ -898,7 +893,6 @@ unsafe fn export_backup(context: &Context, dir: *const libc::c_char) -> libc::c_
|
|||||||
as_str(context.get_blobdir())
|
as_str(context.get_blobdir())
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user