This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ #include " processManager.h"
2+ #include < cstdlib>
3+ #include < trantor/utils/Logger.h>
4+
5+ void processManager::destroy (
6+ const HttpRequestPtr &req,
7+ std::function<void (const HttpResponsePtr &)> &&callback) {
8+ LOG_INFO << " Program is exitting, goodbye!" ;
9+ exit (0 );
10+ return ;
11+ };
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < drogon/HttpController.h>
4+ #include < drogon/HttpTypes.h>
5+
6+ using namespace drogon ;
7+
8+ class processManager : public drogon ::HttpController<processManager> {
9+ public:
10+ METHOD_LIST_BEGIN
11+
12+ METHOD_ADD (processManager::destroy, " /destroy" ,
13+ Delete); // path is /processManager/{arg1}/{arg2}/list
14+
15+ METHOD_LIST_END
16+
17+ void destroy (const HttpRequestPtr &req,
18+ std::function<void (const HttpResponsePtr &)> &&callback);
19+ };
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ int main(int argc, char* argv[])
4949 }
5050
5151 int logical_cores = std::thread::hardware_concurrency ();
52- int drogon_thread_num = 1 ; // temporarily set thread num to 1
52+ int drogon_thread_num = std::thread::hardware_concurrency () ; // temporarily set thread num to 1
5353 nitro_utils::nitro_logo ();
5454#ifdef NITRO_VERSION
5555 LOG_INFO << " Nitro version: " << NITRO_VERSION;
You can’t perform that action at this time.
0 commit comments