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

Commit 8fdff72

Browse files
authored
fix: handle stop server (#1048)
1 parent c693e55 commit 8fdff72

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

engine/commands/run_cmd.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ bool RunCmd::IsModelExisted(const std::string& model_id) {
7070
try {
7171
config::YamlHandler handler;
7272
handler.ModelConfigFromFile(entry.path().string());
73-
std::cout << entry.path().stem().string() << std::endl;
7473
if (entry.path().stem().string() == model_id) {
7574
return true;
7675
}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#include "processManager.h"
2-
#include <cstdlib>
2+
#include "utils/cortex_utils.h"
3+
34
#include <trantor/utils/Logger.h>
5+
#include <cstdlib>
46

57
void processManager::destroy(
6-
const HttpRequestPtr &req,
7-
std::function<void(const HttpResponsePtr &)> &&callback) {
8+
const HttpRequestPtr& req,
9+
std::function<void(const HttpResponsePtr&)>&& callback) {
10+
app().quit();
11+
Json::Value ret;
12+
ret["message"] = "Program is exitting, goodbye!";
13+
auto resp = cortex_utils::CreateCortexHttpJsonResponse(ret);
14+
resp->setStatusCode(k200OK);
15+
callback(resp);
816
LOG_INFO << "Program is exitting, goodbye!";
9-
exit(0);
10-
return;
1117
};

0 commit comments

Comments
 (0)