Skip to content

Commit

Permalink
namizun v1.3.2
Browse files Browse the repository at this point in the history
- bug fixed on coefficient_uploader_threads_count
- readme updated
  • Loading branch information
malkemit committed Dec 11, 2022
1 parent b99ecc6 commit 47cb227
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
2 changes: 1 addition & 1 deletion uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 47cb227

Please sign in to comment.