reset file handles limit on windows
This commit is contained in:
parent
c171311fc8
commit
a003db7e1a
|
@ -1601,6 +1601,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);
|
||||
|
||||
|
|
|
@ -954,3 +954,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