mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix: show managed stuff on privileged port (#4433)
* fix: show managed stuff on privileged port * chore: comments
This commit is contained in:
parent
c77e7cc09f
commit
f291ae27cb
1 changed files with 6 additions and 2 deletions
|
@ -2247,6 +2247,9 @@ void ServerFamily::Info(CmdArgList args, const CommandContext& cmd_cntx) {
|
||||||
|
|
||||||
ServerState* ss = ServerState::tlocal();
|
ServerState* ss = ServerState::tlocal();
|
||||||
|
|
||||||
|
bool show_managed_info =
|
||||||
|
!absl::GetFlag(FLAGS_managed_service_info) || cmd_cntx.conn_cntx->conn()->IsPrivileged();
|
||||||
|
|
||||||
if (should_enter("SERVER")) {
|
if (should_enter("SERVER")) {
|
||||||
auto kind = ProactorBase::me()->GetKind();
|
auto kind = ProactorBase::me()->GetKind();
|
||||||
const char* multiplex_api = (kind == ProactorBase::IOURING) ? "iouring" : "epoll";
|
const char* multiplex_api = (kind == ProactorBase::IOURING) ? "iouring" : "epoll";
|
||||||
|
@ -2255,7 +2258,8 @@ void ServerFamily::Info(CmdArgList args, const CommandContext& cmd_cntx) {
|
||||||
append("dragonfly_version", GetVersion());
|
append("dragonfly_version", GetVersion());
|
||||||
append("redis_mode", GetRedisMode());
|
append("redis_mode", GetRedisMode());
|
||||||
append("arch_bits", 64);
|
append("arch_bits", 64);
|
||||||
if (!absl::GetFlag(FLAGS_managed_service_info)) {
|
|
||||||
|
if (show_managed_info) {
|
||||||
append("os", GetOSString());
|
append("os", GetOSString());
|
||||||
append("thread_count", service_.proactor_pool().size());
|
append("thread_count", service_.proactor_pool().size());
|
||||||
}
|
}
|
||||||
|
@ -2526,7 +2530,7 @@ void ServerFamily::Info(CmdArgList args, const CommandContext& cmd_cntx) {
|
||||||
append("role", "master");
|
append("role", "master");
|
||||||
append("connected_slaves", replicas_info.size());
|
append("connected_slaves", replicas_info.size());
|
||||||
|
|
||||||
if (!absl::GetFlag(FLAGS_managed_service_info)) {
|
if (show_managed_info) {
|
||||||
for (size_t i = 0; i < replicas_info.size(); i++) {
|
for (size_t i = 0; i < replicas_info.size(); i++) {
|
||||||
auto& r = replicas_info[i];
|
auto& r = replicas_info[i];
|
||||||
// e.g. slave0:ip=172.19.0.3,port=6379,state=full_sync
|
// e.g. slave0:ip=172.19.0.3,port=6379,state=full_sync
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue