routertools: Fix MySQL query setting rx/tx to zero

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-01-16 18:58:15 +01:00
parent a6ae88955e
commit e04c657d46
1 changed files with 2 additions and 2 deletions

View File

@ -337,9 +337,9 @@ def detect_offline_routers(mysql):
""",(threshold,))
mysql.execute("""
UPDATE router_netif AS n
INNER JOIN router ON router.id = router_netif.router
INNER JOIN router AS r ON r.id = n.router
SET n.rx = 0, n.tx = 0
WHERE last_contact < %s AND status <> 'offline' AND status <> 'orphaned'
WHERE r.last_contact < %s AND r.status <> 'offline' AND r.status <> 'orphaned'
""",(threshold,))
mysql.commit()