Skip to content

Commit

Permalink
Don't do anything in case an entry that is external is being exported to
Browse files Browse the repository at this point in the history
the same location.
  • Loading branch information
rklaehn committed Mar 13, 2024
1 parent aa3d0f9 commit ab02afa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions iroh-bytes/src/store/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,10 +1612,16 @@ impl ActorState {
})?
.to_owned();
// we can not reference external files, so we just copy them. But this does not have to happen in the actor.
self.rt.spawn_blocking(move || {
tx.send(export_file_copy(temp_tag, path, size, target, progress))
.ok();
});
if path == target {
// export to the same path, nothing to do
tx.send(Ok(())).ok();
} else {
// copy in an external thread
self.rt.spawn_blocking(move || {
tx.send(export_file_copy(temp_tag, path, size, target, progress))
.ok();
});
}
}
}
}
Expand Down

0 comments on commit ab02afa

Please sign in to comment.