From 96439f1c4feed562829713c83b193cbfe2b9fb17 Mon Sep 17 00:00:00 2001 From: CandyMi <869646063@qq.com> Date: Wed, 1 Jun 2022 11:31:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0-w=20auto=E5=9C=A8=E5=8D=95?= =?UTF-8?q?=E6=A0=B8=E8=AE=BE=E5=A4=87=E4=B8=8A=E7=9A=84=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core_start.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core_start.c b/src/core_start.c index 1d581ce..c06ff87 100644 --- a/src/core_start.c +++ b/src/core_start.c @@ -95,7 +95,7 @@ static inline void cfadmin_specify_nprocess(const char* w) { nprocess = 1; /* 自动检查可用核心数量 */ if (!strcmp(w, "auto")) - nprocess = sysconf(_SC_NPROCESSORS_ONLN) < 1 ? 1 : sysconf(_SC_NPROCESSORS_ONLN); + nprocess = sysconf(_SC_NPROCESSORS_ONLN) < 2 ? 2 : sysconf(_SC_NPROCESSORS_ONLN); } /* 后台运行 */ @@ -290,8 +290,8 @@ int main(int argc, char const *argv[]) { cfadmin_init_args(argc, argv); #if defined(__MSYS__) || defined(__CYGWIN__) - /* Windows下不可使用多进程 */ - nprocess = 1; + /* Windows下不可使用多进程 */ + nprocess = 1; #else int n = -1; if (getenv("cfadmin_nprocess"))