Skip to content

Commit

Permalink
Erase dead channels
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Aug 7, 2024
1 parent 86cd7d9 commit 5af47d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions nano/lib/stats_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ enum class detail
failed_send_telemetry_req,
empty_payload,
cleanup_outdated,
erase_stale,

// vote generator
generator_broadcasts,
Expand Down
8 changes: 6 additions & 2 deletions nano/node/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,14 @@ void nano::telemetry::cleanup ()
// Remove if telemetry data is stale
if (!check_timeout (entry))
{
stats.inc (nano::stat::type::telemetry, nano::stat::detail::cleanup_outdated);
stats.inc (nano::stat::type::telemetry, nano::stat::detail::erase_stale);
return true; // Erase
}
if (!entry.channel->alive ())
{
stats.inc (nano::stat::type::telemetry, nano::stat::detail::erase_dead);
return true; // Erase
}

return false; // Do not erase
});
}
Expand Down

0 comments on commit 5af47d2

Please sign in to comment.