Hashes match now.
This commit is contained in:
@ -7,10 +7,11 @@
|
||||
#include "services.hpp"
|
||||
#include "config.hpp"
|
||||
#include "templates.hpp"
|
||||
#include "contrib/transwarp.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <execution>
|
||||
#include <filesystem>
|
||||
|
||||
namespace dropshell {
|
||||
@ -49,14 +50,15 @@ std::vector<ServerInfo> get_configured_servers() {
|
||||
return servers;
|
||||
}
|
||||
|
||||
// https://github.com/bloomen/transwarp?tab=readme-ov-file#range-functions
|
||||
void list_servers() {
|
||||
auto servers = get_configured_servers();
|
||||
|
||||
tableprint tp("All DropShell Servers");
|
||||
tp.add_row({"Name", "Address", "Health", "Ports"});
|
||||
|
||||
std::for_each(std::execution::par, servers.begin(), servers.end(), [&](const ServerInfo& server) {
|
||||
|
||||
transwarp::parallel exec{servers.size()};
|
||||
auto task = transwarp::for_each(exec, servers.begin(), servers.end(), [&](const ServerInfo& server) {
|
||||
std::map<std::string, ServiceStatus> status = service_runner::get_all_services_status(server.name);
|
||||
|
||||
std::set<int> ports_used;
|
||||
@ -71,6 +73,7 @@ void list_servers() {
|
||||
|
||||
tp.add_row({server.name, server.ssh_host, serviceticks, ports_used_str});
|
||||
});
|
||||
task->wait();
|
||||
tp.print();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user