Skip to content

Commit

Permalink
Avoid division by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
calum-chamberlain authored Jun 12, 2024
1 parent acab39e commit 30387d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rt_eqcorrscan/database/database_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _chunksize(
divisor: int = 100, # Used to give more up-to-date progress reports
) -> int:
max_workers = max_workers or cpu_count()
chunksize = n_tasks // (max_workers - 1)
chunksize = n_tasks // max(1, max_workers - 1)
chunksize //= divisor
return max(chunksize, 1)

Expand Down

0 comments on commit 30387d2

Please sign in to comment.