api/alfred: Only log reboot if uptime difference greater than 5 min

If we have two gateways per hood, uptime may vary and cause
frequent logged reboots.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-01-09 00:22:14 +01:00
parent de7c5b2874
commit c3adf5fd68
1 changed files with 1 additions and 1 deletions

View File

@ -265,7 +265,7 @@ def import_nodewatcher_xml(mysql, mac, xml, banned, netifdict):
if olddata:
# fire events
with suppress(KeyError, TypeError, UnboundLocalError):
if olddata["sys_uptime"] > router_update["sys_uptime"]:
if (olddata["sys_uptime"] - 300) > router_update["sys_uptime"]:
events_append(mysql,router_id,"reboot","")
with suppress(KeyError, TypeError, UnboundLocalError):