Skip to content

Commit

Permalink
fix: handle stop server (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev authored Aug 29, 2024
1 parent c693e55 commit 8fdff72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 0 additions & 1 deletion engine/commands/run_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ bool RunCmd::IsModelExisted(const std::string& model_id) {
try {
config::YamlHandler handler;
handler.ModelConfigFromFile(entry.path().string());
std::cout << entry.path().stem().string() << std::endl;
if (entry.path().stem().string() == model_id) {
return true;
}
Expand Down
16 changes: 11 additions & 5 deletions engine/controllers/processManager.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#include "processManager.h"
#include <cstdlib>
#include "utils/cortex_utils.h"

#include <trantor/utils/Logger.h>
#include <cstdlib>

void processManager::destroy(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) {
const HttpRequestPtr& req,
std::function<void(const HttpResponsePtr&)>&& callback) {
app().quit();
Json::Value ret;
ret["message"] = "Program is exitting, goodbye!";
auto resp = cortex_utils::CreateCortexHttpJsonResponse(ret);
resp->setStatusCode(k200OK);
callback(resp);
LOG_INFO << "Program is exitting, goodbye!";
exit(0);
return;
};

0 comments on commit 8fdff72

Please sign in to comment.