reset file handles limit on windows

This commit is contained in:
xsren 2023-09-12 10:44:11 +08:00
parent fe6f8d60f6
commit 08ca751483
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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;
}