0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-02-18 17:50:16 +01:00

modules/console: Command to clear all peer errors.

This commit is contained in:
Jason Volk 2018-04-10 21:04:25 -07:00
parent 516d1797c9
commit 9ed97730e6

View file

@ -896,8 +896,30 @@ console_cmd__net__peer(opt &out, const string_view &line)
}
bool
console_cmd__net__peer__clear(opt &out, const string_view &line)
console_cmd__net__peer__error__clear__all(opt &out, const string_view &line)
{
size_t cleared(0);
for(auto &pair : ircd::server::peers)
{
const auto &name{pair.first};
assert(bool(pair.second));
auto &peer{*pair.second};
cleared += peer.err_clear();
}
out << "cleared " << cleared
<< " of " << ircd::server::peers.size()
<< std::endl;
return true;
}
bool
console_cmd__net__peer__error__clear(opt &out, const string_view &line)
{
if(empty(line))
return console_cmd__net__peer__error__clear__all(out, line);
const net::hostport hp
{
token(line, ' ', 0)