mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-04-21 23:49:23 -04:00
Added check to skip nodes with a none type last heard status when gathering statistics
This commit is contained in:
parent
141eb05156
commit
eebe41c1c3
@ -135,7 +135,7 @@ def handle_stats_steps(sender_id, message, step, interface):
|
||||
total_nodes = len(interface.nodes)
|
||||
else:
|
||||
time_limit = current_time - seconds
|
||||
total_nodes = sum(1 for node in interface.nodes.values() if node.get('lastHeard', 0) >= time_limit)
|
||||
total_nodes = sum(1 for node in interface.nodes.values() if node.get('lastHeard', 0) is not None and node.get('lastHeard', 0) >= time_limit)
|
||||
total_nodes_summary.append(f"- {period}: {total_nodes}")
|
||||
|
||||
response = "Total nodes seen:\n" + "\n".join(total_nodes_summary)
|
||||
|
Loading…
x
Reference in New Issue
Block a user