New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): resume uploads across multiple safe
runs
#907
Conversation
1c0e56c
to
69b2294
Compare
safe
runssafe
runs
6abbb3d
to
3e1dd7a
Compare
// use the chunk_artifacts_dir directly; This should not result in any | ||
// undefined behaviour. The resume operation will be disabled if we don't | ||
// use the `path_xor` dir. | ||
// TODO: maybe error out if we get any fs errors. |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
sn_protocol/src/test_utils.rs
Outdated
|
||
use std::fmt; | ||
|
||
pub fn assert_lists<I, J, K>(a: I, b: J) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate or add docs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added docs to that function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe assert_list_eq
would be a better name?
3e1dd7a
to
6ba193f
Compare
sn_cli/src/subcommands/files/mod.rs
Outdated
.iter() | ||
.map(|(file_addr, chunked_file)| (*file_addr, chunked_file.file_name.clone())) | ||
.collect::<Vec<_>>(); | ||
// Return early if we hav no files to pay/verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Return early if we hav no files to pay/verify | |
// Return early if we have no files to pay/verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…sString to String
6ba193f
to
31f33f9
Compare
Description
Summary generated by Reviewpad on 26 Oct 23 14:12 UTC
This pull request involves renaming the file "sn_cli/src/subcommands/files.rs" to "sn_cli/src/subcommands/files/mod.rs" and making changes to imports, module structure, function parameters, and method calls. Some code has been moved to a new module called "chunk_manager". The chunking functionality has been refactored and is now handled by the ChunkManager struct. The upload_files function has been modified to use the ChunkManager and no longer requires the wallet_dir_path parameter. The file_names_path has also been changed to use the root_dir. Some code related to logging has been commented out. Overall, the changes seem to improve the organization and modularity of the code.
The file
wallet.rs
has undergone several changes. Here is a summary of the changes made:ChunkManager
from thefiles
module.chunk_path
from thefiles
module.wallet_dir_path
withroot_dir
.file_api
object initialization withFiles::new(client.clone(), root_dir.to_path_buf())
.chunk_path
function withmanager.chunk_path(&path)?
.chunked_files.values()
withmanager.get_chunks().iter()
.ChunkedFile
struct definition and its associated code.This file contains the implementation of a chunk manager, which is responsible for chunking files and managing the chunks. It includes several structs and methods for chunking files, storing chunk information, and retrieving chunks. The chunk manager takes a root directory and a files API as input and provides methods for chunking files, retrieving chunks, and marking finished chunks. The implementation uses external libraries such as color_eyre, rayon, sn_client, xor_name, walkdir for various functionalities.
Overall, this file provides the necessary functionality for chunking and managing files in the SAFE Network Software.
Please review these changes and consider their impact on the code. Let me know if you need more information.