Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit bf4025b

Browse files
committed
set thread num
1 parent 3058054 commit bf4025b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ int main(int argc, char *argv[]) {
3636
}
3737

3838
int logical_cores = std::thread::hardware_concurrency();
39+
int drogon_thread_num = std::max(thread_num, logical_cores);
3940
nitro_utils::nitro_logo();
4041
LOG_INFO << "Server started, listening at: " << host << ":" << port;
4142
LOG_INFO << "Please load your model";
4243
drogon::app().addListener(host, port);
43-
drogon::app().setThreadNum(std::max(thread_num, logical_cores));
44+
drogon::app().setThreadNum(drogon_thread_num);
4445
LOG_INFO << "Number of thread is:" << drogon::app().getThreadNum();
4546

4647
drogon::app().run();

0 commit comments

Comments
 (0)