feat: fix get dir size error
This commit is contained in:
parent
0166ecfea1
commit
a6bd63506f
|
@ -139,7 +139,6 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
||||||
bool tsc);
|
bool tsc);
|
||||||
void taosCleanupCfg();
|
void taosCleanupCfg();
|
||||||
void taosCfgDynamicOptions(const char *option, const char *value);
|
void taosCfgDynamicOptions(const char *option, const char *value);
|
||||||
void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary);
|
|
||||||
|
|
||||||
struct SConfig *taosGetCfg();
|
struct SConfig *taosGetCfg();
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,22 @@ int32_t tsTtlPushInterval = 86400;
|
||||||
int32_t tsGrantHBInterval = 60;
|
int32_t tsGrantHBInterval = 60;
|
||||||
|
|
||||||
#ifndef _STORAGE
|
#ifndef _STORAGE
|
||||||
int32_t taosSetTfsCfg(SConfig *pCfg) { return 0; }
|
int32_t taosSetTfsCfg(SConfig *pCfg) {
|
||||||
|
SConfigItem *pItem = cfgGetItem(pCfg, "dataDir");
|
||||||
|
memset(tsDataDir, 0, PATH_MAX);
|
||||||
|
|
||||||
|
int32_t size = taosArrayGetSize(pItem->array);
|
||||||
|
tsDiskCfgNum = 1;
|
||||||
|
tstrncpy(tsDiskCfg[0].dir, pItem->str, TSDB_FILENAME_LEN);
|
||||||
|
tsDiskCfg[0].level = 0;
|
||||||
|
tsDiskCfg[0].primary = 1;
|
||||||
|
tstrncpy(tsDataDir, pItem->str, PATH_MAX);
|
||||||
|
if (taosMulMkDir(tsDataDir) != 0) {
|
||||||
|
uError("failed to create dataDir:%s", tsDataDir);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
int32_t taosSetTfsCfg(SConfig *pCfg);
|
int32_t taosSetTfsCfg(SConfig *pCfg);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue