mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
modules/console: Command to only iterate peers with errors.
This commit is contained in:
parent
7360999b30
commit
b95c27826b
1 changed files with 36 additions and 0 deletions
|
@ -939,6 +939,42 @@ console_cmd__peer(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__peer__error(opt &out, const string_view &line)
|
||||
{
|
||||
for(const auto &pair : ircd::server::peers)
|
||||
{
|
||||
using std::setw;
|
||||
using std::left;
|
||||
using std::right;
|
||||
|
||||
const auto &host{pair.first};
|
||||
assert(bool(pair.second));
|
||||
const auto &peer{*pair.second};
|
||||
if(!peer.err_has())
|
||||
continue;
|
||||
|
||||
const net::ipport &ipp{peer.remote};
|
||||
out << setw(40) << right << host;
|
||||
|
||||
if(ipp)
|
||||
out << ' ' << setw(22) << left << ipp;
|
||||
else
|
||||
out << ' ' << setw(22) << left << " ";
|
||||
|
||||
out << peer.e->etime;
|
||||
|
||||
if(peer.err_msg())
|
||||
out << " :" << peer.err_msg();
|
||||
else
|
||||
out << " <unknown error>"_sv;
|
||||
|
||||
out << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__peer__error__clear__all(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue