reset file handles limit on windows
This commit is contained in:
parent
fe6f8d60f6
commit
08ca751483
|
@ -1598,6 +1598,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
|||
if (taosSetS3Cfg(tsCfg) != 0) return -1;
|
||||
}
|
||||
taosSetSystemCfg(tsCfg);
|
||||
if (taosSetFileHandlesLimit() != 0) return -1;
|
||||
|
||||
cfgDumpCfg(tsCfg, tsc, false);
|
||||
|
||||
|
|
|
@ -956,3 +956,12 @@ cmp_end:
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t taosSetFileHandlesLimit() {
|
||||
#ifdef WINDOWS
|
||||
const int max_handles = 8192;
|
||||
int res = _setmaxstdio(max_handles);
|
||||
return res == max_handles ? 0 : -1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue