automerge
This commit is contained in:
@ -528,23 +528,26 @@ impl AccountsDB {
|
|||||||
AppendVec::new_relative_path(slot_id, storage_entry.id);
|
AppendVec::new_relative_path(slot_id, storage_entry.id);
|
||||||
let append_vec_abs_path =
|
let append_vec_abs_path =
|
||||||
append_vecs_path.as_ref().join(&append_vec_relative_path);
|
append_vecs_path.as_ref().join(&append_vec_relative_path);
|
||||||
let mut copy_options = CopyOptions::new();
|
let target = local_dir.join(append_vec_abs_path.file_name().unwrap());
|
||||||
copy_options.overwrite = true;
|
if std::fs::rename(append_vec_abs_path.clone(), target).is_err() {
|
||||||
let e = fs_extra::move_items(
|
let mut copy_options = CopyOptions::new();
|
||||||
&vec![&append_vec_abs_path],
|
copy_options.overwrite = true;
|
||||||
&local_dir,
|
let e = fs_extra::move_items(
|
||||||
©_options,
|
&vec![&append_vec_abs_path],
|
||||||
)
|
&local_dir,
|
||||||
.map_err(|e| {
|
©_options,
|
||||||
AccountsDB::get_io_error(&format!(
|
)
|
||||||
"Unable to move {:?} to {:?}: {}",
|
.map_err(|e| {
|
||||||
append_vec_abs_path, local_dir, e
|
AccountsDB::get_io_error(&format!(
|
||||||
))
|
"Unable to move {:?} to {:?}: {}",
|
||||||
});
|
append_vec_abs_path, local_dir, e
|
||||||
if e.is_err() {
|
))
|
||||||
info!("{:?}", e);
|
});
|
||||||
continue;
|
if e.is_err() {
|
||||||
}
|
info!("{:?}", e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Notify the AppendVec of the new file location
|
// Notify the AppendVec of the new file location
|
||||||
let local_path = local_dir.join(append_vec_relative_path);
|
let local_path = local_dir.join(append_vec_relative_path);
|
||||||
|
Reference in New Issue
Block a user