Skip to content

Commit

Permalink
namizun v1.3.1
Browse files Browse the repository at this point in the history
- bug fixed on udp.py
  • Loading branch information
malkemit committed Dec 11, 2022
1 parent 5931540 commit b99ecc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions namizun_core/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def adjustment_of_upload_size_and_uploader_count(total_upload_size):
global total_upload_size_for_each_ip, uploader_count
uploader_count -= int(0.2 * uploader_count)
total_upload_size_for_each_ip -= int(0.05 * total_upload_size_for_each_ip)
if total_upload_size_for_each_ip * uploader_count < total_upload_size:
if total_upload_size_for_each_ip * uploader_count > total_upload_size:
adjustment_of_upload_size_and_uploader_count(total_upload_size)


Expand All @@ -38,8 +38,8 @@ def set_upload_size_and_uploader_count(total_upload_size, total_uploader_count):
coefficient_of_upload = int((database.get_cache_parameter('coefficient_buffer_size') + 1) / 2)
upload_size_max_range = choices([50, 100, 150], [1, 2, 3], k=1)[0]
total_upload_size_for_each_ip = randint((upload_size_max_range - 50) * coefficient_of_upload,
upload_size_max_range * coefficient_of_upload)
if total_upload_size_for_each_ip * uploader_count < total_upload_size:
upload_size_max_range * coefficient_of_upload) * 1024 * 1024
if total_upload_size_for_each_ip * uploader_count > total_upload_size:
adjustment_of_upload_size_and_uploader_count(total_upload_size)


Expand Down

0 comments on commit b99ecc6

Please sign in to comment.