Skip to content

Commit

Permalink
allocate-torrents: limit to specific computers
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanjacobd committed Dec 30, 2024
1 parent b9692b7 commit 7848eed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/multidb/allocate_torrents.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def parse_args():
)
parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=str, help="Upload limit")

parser.add_argument("--hosts", action=argparse_utils.ArgparseList, help="Limit to specific computers")

arggroups.debug(parser)

parser.add_argument("computer_database")
Expand Down Expand Up @@ -91,6 +93,9 @@ def allocate_torrents():
},
)
)
if args.hosts:
disks = [d for d in disks if d["host"] in args.hosts]

total_available = sum(d["free"] - args.min_free_space for d in disks)
print(f"{len(disks)} disks matched. {strings.file_size(total_available)} available space")

Expand Down

0 comments on commit 7848eed

Please sign in to comment.