make api server use only a single thread

This commit is contained in:
anon 2023-05-31 09:02:32 -03:00
parent c1cbde82a1
commit 2c08f29691

View file

@ -2,6 +2,9 @@ set(TARGET server)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(${TARGET} server.cpp json.hpp httplib.h) add_executable(${TARGET} server.cpp json.hpp httplib.h)
target_compile_definitions(${TARGET} PRIVATE target_compile_definitions(${TARGET} PRIVATE
# single thread
CPPHTTPLIB_THREAD_POOL_COUNT=1
# crash the server in the debug mode, otherwise send http 500 error
$<$<CONFIG:Debug>: $<$<CONFIG:Debug>:
CPPHTTPLIB_NO_EXCEPTIONS=1 CPPHTTPLIB_NO_EXCEPTIONS=1
> >