mirror of
https://codeberg.org/demostf/mover.git
synced 2026-06-03 09:54:17 +02:00
dont actually check for hash mismatch
since at this point this is the only copy there isn't anything we can do to fix any mismatch
This commit is contained in:
parent
79a7781db4
commit
e8ddda506f
1 changed files with 2 additions and 14 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -101,16 +101,6 @@ async fn move_demo(
|
||||||
if target_path.is_file() {
|
if target_path.is_file() {
|
||||||
warn!("target exists");
|
warn!("target exists");
|
||||||
} else {
|
} else {
|
||||||
let calculated_hash = hash(&source_path)?;
|
|
||||||
if calculated_hash != demo.hash {
|
|
||||||
error!(
|
|
||||||
calculated = debug(calculated_hash),
|
|
||||||
stored = debug(demo.hash),
|
|
||||||
"hash mismatch for source"
|
|
||||||
);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
create_dir_all(target_path.parent().unwrap())?;
|
create_dir_all(target_path.parent().unwrap())?;
|
||||||
|
|
||||||
copy(&source_path, &target_path)?;
|
copy(&source_path, &target_path)?;
|
||||||
|
|
@ -119,13 +109,11 @@ async fn move_demo(
|
||||||
let calculated_hash = hash(&target_path)?;
|
let calculated_hash = hash(&target_path)?;
|
||||||
|
|
||||||
if calculated_hash != demo.hash {
|
if calculated_hash != demo.hash {
|
||||||
error!(
|
warn!(
|
||||||
calculated = debug(calculated_hash),
|
calculated = debug(calculated_hash),
|
||||||
stored = debug(demo.hash),
|
stored = debug(demo.hash),
|
||||||
"hash mismatch for target"
|
"hash mismatch for target"
|
||||||
);
|
);
|
||||||
remove_file(&target_path)?;
|
|
||||||
return Ok(());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("renamed");
|
info!("renamed");
|
||||||
|
|
@ -135,7 +123,7 @@ async fn move_demo(
|
||||||
target_backend,
|
target_backend,
|
||||||
&demo.path,
|
&demo.path,
|
||||||
&demo.url,
|
&demo.url,
|
||||||
calculated_hash,
|
demo.hash,
|
||||||
api_key,
|
api_key,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue