File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 66RoutingStatsModule *routingStats;
77
88#define PRINT_STATS_INTERVAL_MS (60 * 1000 ) // Print our own stats every 60 seconds
9+ #define PRINT_STATS_WINDOW_SECS 900 // If not transmitting stats, reset the window every 15 minutes
910
1011/* *
1112 * Log a routing event
@@ -102,6 +103,11 @@ int32_t RoutingStatsModule::runOnce()
102103 printStats (&stats, nodeDB->getNodeNum ());
103104 last_print_millis = now;
104105 next_print_millis = last_print_millis + PRINT_STATS_INTERVAL_MS;
106+ if (!config.device .routing_stats_broadcast_secs && (last_tx_millis + PRINT_STATS_WINDOW_SECS * 1000 ) < now) {
107+ // Reset stats window if we're not configured to broadcast stats
108+ stats = {};
109+ last_tx_millis = now;
110+ }
105111 }
106112
107113 if (next_tx_millis > now)
You can’t perform that action at this time.
0 commit comments