Update source/src/commands/list.cpp
This commit is contained in:
@@ -103,7 +103,6 @@ void list_servers() {
|
|||||||
|
|
||||||
// First, check which servers are online (with caching per server, not per user)
|
// First, check which servers are online (with caching per server, not per user)
|
||||||
std::map<std::string, bool> server_online_status;
|
std::map<std::string, bool> server_online_status;
|
||||||
std::mutex online_status_mutex;
|
|
||||||
|
|
||||||
transwarp::parallel exec{server_user_pairs.size()};
|
transwarp::parallel exec{server_user_pairs.size()};
|
||||||
auto task = transwarp::for_each(exec, server_user_pairs.begin(), server_user_pairs.end(), [&](const server_user_pair& sup) {
|
auto task = transwarp::for_each(exec, server_user_pairs.begin(), server_user_pairs.end(), [&](const server_user_pair& sup) {
|
||||||
@@ -122,7 +121,6 @@ void list_servers() {
|
|||||||
// Check if server is online (with caching to avoid redundant checks for multiple users)
|
// Check if server is online (with caching to avoid redundant checks for multiple users)
|
||||||
bool is_online = false;
|
bool is_online = false;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(online_status_mutex);
|
|
||||||
auto it = server_online_status.find(sup.server.get_server_name());
|
auto it = server_online_status.find(sup.server.get_server_name());
|
||||||
if (it != server_online_status.end()) {
|
if (it != server_online_status.end()) {
|
||||||
is_online = it->second;
|
is_online = it->second;
|
||||||
@@ -158,11 +156,10 @@ void list_servers() {
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(tp_mutex);
|
std::lock_guard<std::mutex> lock(tp_mutex);
|
||||||
tp.add_row({sup.server.get_server_name(), address_display, sup.user.user, serviceticks, ports_used_str});
|
tp.add_row({sup.server.get_server_name(), address_display, sup.user.user, serviceticks, ports_used_str});
|
||||||
|
|
||||||
++checked;
|
++checked;
|
||||||
// print out a tick character for each server checked.
|
|
||||||
info << checked << " ✓ " << std::flush;
|
|
||||||
}
|
}
|
||||||
|
// print out a tick character for each server checked.
|
||||||
|
info << checked << " ✓ " << std::flush;
|
||||||
});
|
});
|
||||||
task->wait();
|
task->wait();
|
||||||
info << std::endl << std::endl;
|
info << std::endl << std::endl;
|
||||||
|
Reference in New Issue
Block a user