提交 24f368c7 编写于 作者: K kailixu

enh: read active code from cfg

上级 e3f194ed
......@@ -77,6 +77,10 @@ extern int32_t tsElectInterval;
extern int32_t tsHeartbeatInterval;
extern int32_t tsHeartbeatTimeout;
// dnode
extern char tsActive[];
extern char tsConnActive[];
// vnode
extern int64_t tsVndCommitMaxIntervalMs;
......
......@@ -66,6 +66,10 @@ int32_t tsElectInterval = 25 * 1000;
int32_t tsHeartbeatInterval = 1000;
int32_t tsHeartbeatTimeout = 20 * 1000;
// dnode
char tsActive[TSDB_ACTIVE_KEY_LEN] = {0};
char tsConnActive[TSDB_CONN_ACTIVE_KEY_LEN] = {0};
// vnode
int64_t tsVndCommitMaxIntervalMs = 600 * 1000;
......@@ -490,6 +494,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, 0) != 0) return -1;
if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, 0) != 0) return -1;
if (cfgAddString(pCfg, "activeCode", tsActive, 0) != 0) return -1;
if (cfgAddString(pCfg, "cActiveCode", tsConnActive, 0) != 0) return -1;
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, 0) != 0) return -1;
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, 0) != 0) return -1;
if (cfgAddString(pCfg, "monitorFqdn", tsMonitorFqdn, 0) != 0) return -1;
......@@ -885,6 +892,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64;
tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64;
tstrncpy(tsActive, cfgGetItem(pCfg, "activeCode")->str, sizeof(tsActive));
tstrncpy(tsConnActive, cfgGetItem(pCfg, "cActiveCode")->str, sizeof(tsConnActive));
tsStartUdfd = cfgGetItem(pCfg, "udf")->bval;
tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs));
tstrncpy(tsUdfdLdLibPath, cfgGetItem(pCfg, "udfdLdLibPath")->str, sizeof(tsUdfdLdLibPath));
......@@ -927,6 +937,10 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
tsAsyncLog = cfgGetItem(pCfg, "asyncLog")->bval;
} else if (strcasecmp("assert", name) == 0) {
tsAssert = cfgGetItem(pCfg, "assert")->bval;
} else if (strcasecmp("activeCode", name) == 0) {
SConfigItem *pActiveItem = cfgGetItem(pCfg, "activeCode");
snprintf(tsActive, sizeof(tsActive), "%s", pActiveItem->str);
cfgSetItem(pCfg, "activeCode", tsActive, pActiveItem->stype);
}
break;
}
......@@ -946,7 +960,12 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
cDebugFlag = cfgGetItem(pCfg, "cDebugFlag")->i32;
} else if (strcasecmp("crashReporting", name) == 0) {
tsEnableCrashReport = cfgGetItem(pCfg, "crashReporting")->bval;
} else if (strcasecmp("cActiveCode", name) == 0) {
SConfigItem *pActiveItem = cfgGetItem(pCfg, "cActiveCode");
snprintf(tsConnActive, sizeof(tsConnActive), "%s", pActiveItem->str);
cfgSetItem(pCfg, "cActiveCode", tsActive, pActiveItem->stype);
}
break;
}
case 'd': {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册