fix
parent
572fc3af47
commit
18fc489b91
|
|
@ -4,8 +4,7 @@ output_txt_path: /var/www/downloads/speeds.txt
|
||||||
ros_dynamic_speed: True
|
ros_dynamic_speed: True
|
||||||
ros_ip: 192.168.88.1
|
ros_ip: 192.168.88.1
|
||||||
ros_queues:
|
ros_queues:
|
||||||
- WAN
|
- all
|
||||||
- VOIP
|
|
||||||
ros_queues_except:
|
ros_queues_except:
|
||||||
- dummy
|
- dummy
|
||||||
ros_du_invert: False
|
ros_du_invert: False
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import speedtest
|
||||||
from dbo import Entry
|
from dbo import Entry
|
||||||
import routeros_api
|
import routeros_api
|
||||||
|
|
||||||
|
|
||||||
config = read_config()
|
config = read_config()
|
||||||
secrets = read_config('secrets')
|
secrets = read_config('secrets')
|
||||||
|
|
||||||
|
|
@ -178,13 +179,15 @@ def ros_dynamic_speed(upload, download):
|
||||||
if queue['name'] in config['ros_queues'] or ("all" in config['ros_queues'] and queue["name"] not in config['ros_queues_except']):
|
if queue['name'] in config['ros_queues'] or ("all" in config['ros_queues'] and queue["name"] not in config['ros_queues_except']):
|
||||||
log.debug(
|
log.debug(
|
||||||
f"Adjust Queue {queue['name']}: max_limit {int(upload)}/{int(download)}")
|
f"Adjust Queue {queue['name']}: max_limit {int(upload)}/{int(download)}")
|
||||||
|
try:
|
||||||
if config["ros_du_invert"] == True:
|
if config["ros_du_invert"] == True:
|
||||||
# Inverting upload and download values, because master queue is most likely applied to the bridge
|
# Inverting upload and download values, because master queue is most likely applied to the bridge
|
||||||
list_queues.set(id=queue['id'], max_limit=f"{int(download)}/{int(upload)}")
|
list_queues.set(id=queue['id'], max_limit=f"{int(download)}/{int(upload)}")
|
||||||
else:
|
else:
|
||||||
# Not inverting, use this in case master queue is applied to something like LTE interface
|
# Not inverting, use this in case master queue is applied to something like LTE interface
|
||||||
list_queues.set(id=queue['id'], max_limit=f"{int(upload)}/{int(download)}")
|
list_queues.set(id=queue['id'], max_limit=f"{int(upload)}/{int(download)}")
|
||||||
|
except:
|
||||||
|
log.error("Unable to change queue settings.", exc_info=True)
|
||||||
connection.disconnect()
|
connection.disconnect()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue