Skip to content

Commit

Permalink
Use modulus to better distribute use of archive disks vs. index
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky authored Jul 12, 2021
1 parent c4fe66c commit 69ab26f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plotman/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def archive(dir_cfg: configuration.Directories, arch_cfg: configuration.Archivin
available = [(d, space) for (d, space) in archdir_freebytes.items() if
space > (chosen_plot_size + free_space_margin)]
if len(available) > 0:
index = min(arch_cfg.index, len(available) - 1)
index = arch_cfg.index % (len(available) - 1)
(archdir, freespace) = sorted(available)[index]

if not archdir:
Expand Down

0 comments on commit 69ab26f

Please sign in to comment.