Skip to content

Commit

Permalink
CLI kwargs for rsync max batch/file workers
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Mar 5, 2024
1 parent 91f13f6 commit a7b4a8a
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions saturnfs/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,25 @@ def delete(path: str, recursive: bool):
default=False,
help="Delete paths from the destination that are missing in the source",
)
def rsync(source_path: str, destination_path: str, delete_missing: bool, quiet: bool):
@click.option(
"--max-batch-workers",
type=int,
default=settings.SATURNFS_DEFAULT_MAX_WORKERS,
help="Maximum number of threads to run for batched file uploads",
)
@click.option(
"--max-file-workers",
type=int,
default=1,
help="Maximum number of threads to run per file for parallel chunk upload/download"
)
def rsync(
source_path: str,
destination_path: str,
delete_missing: bool,
quiet: bool,
**kwargs,
):
"""
Recursively sync files between two directory trees
"""
Expand All @@ -202,7 +220,9 @@ def rsync(source_path: str, destination_path: str, delete_missing: bool, quiet:
operation = file_op(src_is_local, dst_is_local)
callback = FileOpCallback(operation=operation)

sfs.rsync(source_path, destination_path, delete_missing=delete_missing, callback=callback)
sfs.rsync(
source_path, destination_path, delete_missing=delete_missing, callback=callback, **kwargs
)


@cli.command("ls")
Expand Down

0 comments on commit a7b4a8a

Please sign in to comment.