Loading src/admin.cpp +13 −1 Changes for src/admin.cpp: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -598,8 +598,20 @@ namespace authdb { auto &pclient = g_Cluster->getClient(); if (pclient) { // Fetch cluster health under mutex, then release immediately // to avoid blocking session/replication operations during JSON build decltype(pclient->get_cluster_status()) health; try { std::lock_guard<std::mutex> lock(g_Cluster->getClientMutex()); auto health = pclient->get_cluster_status(); health = pclient->get_cluster_status(); } catch (...) { json_object_object_add(jobj, "status", json_object_new_string("UNAVAILABLE")); json_object_object_add(jobj, "nodes_total", json_object_new_int(0)); json_object_object_add(jobj, "nodes_online", json_object_new_int(0)); sendJson(curreq, jobj); json_object_put(jobj); return; } uint32_t total = health.nodes_total; uint32_t online = health.nodes_online; Loading Loading
src/admin.cpp +13 −1 Changes for src/admin.cpp: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -598,8 +598,20 @@ namespace authdb { auto &pclient = g_Cluster->getClient(); if (pclient) { // Fetch cluster health under mutex, then release immediately // to avoid blocking session/replication operations during JSON build decltype(pclient->get_cluster_status()) health; try { std::lock_guard<std::mutex> lock(g_Cluster->getClientMutex()); auto health = pclient->get_cluster_status(); health = pclient->get_cluster_status(); } catch (...) { json_object_object_add(jobj, "status", json_object_new_string("UNAVAILABLE")); json_object_object_add(jobj, "nodes_total", json_object_new_int(0)); json_object_object_add(jobj, "nodes_online", json_object_new_int(0)); sendJson(curreq, jobj); json_object_put(jobj); return; } uint32_t total = health.nodes_total; uint32_t online = health.nodes_online; Loading