From 2c08f29691d6a69bb1c26db2a239e8a8124c313d Mon Sep 17 00:00:00 2001 From: anon Date: Wed, 31 May 2023 09:02:32 -0300 Subject: [PATCH] make api server use only a single thread --- examples/server/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index b38fa864a..67b086754 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -2,6 +2,9 @@ set(TARGET server) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_executable(${TARGET} server.cpp json.hpp httplib.h) target_compile_definitions(${TARGET} PRIVATE + # single thread + CPPHTTPLIB_THREAD_POOL_COUNT=1 + # crash the server in the debug mode, otherwise send http 500 error $<$: CPPHTTPLIB_NO_EXCEPTIONS=1 >