Protection against creating too small or too large chunks.
(expected_mb: int)
| 84 | |
| 85 | |
| 86 | def limit_es(expected_mb: int) -> int: |
| 87 | """Protection against creating too small or too large chunks.""" |
| 88 | if expected_mb < 1: # < 1 MB |
| 89 | expected_mb = 1 |
| 90 | elif expected_mb > 10**7: # > 10 TB |
| 91 | expected_mb = 10**7 |
| 92 | return expected_mb |
| 93 | |
| 94 | |
| 95 | def calc_chunksize(expected_mb: int) -> int: |