From 586618807d054a437ddf60abf5e044c214c2b37b Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 21 Jul 2023 16:28:48 +0800 Subject: [PATCH] chore: code optimization --- source/dnode/mnode/impl/src/mndDnode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 48cdff4cb5..ae15d4de04 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -711,11 +711,7 @@ _OVER: mndReleaseDnode(pMnode, pDnode); } - if (iter > 15) { - tsGrantHBInterval = 10; - } else { - tsGrantHBInterval = 5; - } + tsGrantHBInterval = MIN(MAX(3, iter / 2), 15); mndTransDrop(pTrans); sdbFreeRaw(pRaw); @@ -1048,11 +1044,8 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) { } mInfo("dnode:%d, start to config, option:%s, value:%s", cfgReq.dnodeId, cfgReq.config, cfgReq.value); - if (strncmp(cfgReq.config, "activeCode_m", 12) == 0) { - cfgReq.config[10] = 0; - } else if (strncmp(cfgReq.config, "cActiveCode_m", 13) == 0) { - cfgReq.config[11] = 0; - } else if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CONFIG_DNODE) != 0) { + if ((pReq->info.ahandle != (void *)0x818611) && + (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CONFIG_DNODE) != 0)) { return -1; }