diff --git a/menu.py b/menu.py index fca10cb..c1fb0e5 100644 --- a/menu.py +++ b/menu.py @@ -35,10 +35,10 @@ def coefficient_of_buffer_size_setter(): def coefficient_uploader_threads_count_setter(): display.banner() - print(f"\n{display.cornsilk}Choose coefficient of uploader threads count? (max = 20, min = 1)\n\n" + print(f"\n{display.cornsilk}Choose coefficient of uploader threads count? (max = 30, min = 1)\n\n" f"{display.red}Warning: The higher the speed, the higher the CPU consumption!{display.cornsilk}\n") - selection = int(input(f"\n{display.cyan}1{display.cornsilk} to {display.cyan}20{display.cornsilk}?")) - if selection in range(1, 21): + selection = int(input(f"\n{display.cyan}1{display.cornsilk} to {display.cyan}30{display.cornsilk}?")) + if selection in range(1, 31): database.set_parameter('coefficient_uploader_threads_count', selection) return main_menu() else: diff --git a/readme.md b/readme.md index 0a897eb..363b1e5 100644 --- a/readme.md +++ b/readme.md @@ -74,6 +74,14 @@ sudo systemctl start namizun.service ln -s /var/www/namizun/else/namizun /usr/local/bin/ && chmod +x /usr/local/bin/namizun ``` +## Update + +- With the following command, you can update the script that you have already installed: + +```bash +cd /var/www/namizun && rm range_ips && git reset --hard HEAD && git pull origin master && source /var/www/namizun/venv/bin/activate && cd /var/www/namizun && pip install . && deactivate && systemctl daemon-reload && chmod +x /usr/local/bin/namizun +``` + ## Configuration - You can use **namizun** tool to configure monitoring. Type the following command to run it: diff --git a/setup.py b/setup.py index b8c5af1..428b276 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='namizun_core', - version='1.3.0', + version='1.3.2', description='Asymmetric upload and download', author='MalKeMit', author_email='khodemalkemit@gmail.com', diff --git a/uploader.py b/uploader.py index 1e85ff0..b3226de 100644 --- a/uploader.py +++ b/uploader.py @@ -20,7 +20,7 @@ def get_network_usage(): def get_uploader_count_base_timeline(): time_in_iran = int(datetime.now(timezone("Asia/Tehran")).strftime("%H")) - default_uploader_count = database.get_cache_parameter('coefficient_uploader_threads_count') * 100 + default_uploader_count = database.get_cache_parameter('coefficient_uploader_threads_count') * 10 maximum_allowed_coefficient = [2, 1.6, 1, 0.6, 0.2, 0.1, 0.6, 1, 1.2, 1.3, 1.4, 1.5, 1.3, 1.4, 1.6, 1.5, 1.3, 1.5, 1.7, 1.8, 2, 1.3, 1.5, 1.8] minimum_allowed_coefficient = [1.6, 1, 0.6, 0.2, 0, 0, 0.2, 0.8, 1, 1.1, 1.2, 1.3,