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

Commit 24166e4

Browse files
committed
chore: update cortexrc fields
1 parent a2e54ce commit 24166e4

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

engine/main.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
void RunServer() {
2828
auto config = file_manager_utils::GetCortexConfig();
29-
LOG_INFO << "Host: " << config.host << " Port: " << config.port << "\n";
29+
LOG_INFO << "Host: " << config.apiServerHost << " Port: " << config.apiServerPort << "\n";
3030

3131
// Create logs/ folder and setup log to file
3232
std::filesystem::create_directory(cortex_utils::logs_folder);
@@ -66,10 +66,10 @@ void RunServer() {
6666
LOG_INFO << "cortex.cpp version: undefined";
6767
#endif
6868

69-
LOG_INFO << "Server started, listening at: " << config.host << ":"
70-
<< config.port;
69+
LOG_INFO << "Server started, listening at: " << config.apiServerHost << ":"
70+
<< config.apiServerPort;
7171
LOG_INFO << "Please load your model";
72-
drogon::app().addListener(config.host, std::stoi(config.port));
72+
drogon::app().addListener(config.apiServerHost, std::stoi(config.apiServerPort));
7373
drogon::app().setThreadNum(drogon_thread_num);
7474
LOG_INFO << "Number of thread is:" << drogon::app().getThreadNum();
7575

engine/utils/config_yaml_utils.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
namespace config_yaml_utils {
1010
struct CortexConfig {
1111
std::string dataFolderPath;
12-
std::string host;
13-
std::string port;
12+
std::string apiServerHost;
13+
std::string apiServerPort;
1414
};
1515

1616
const std::string kCortexFolderName = "cortexcpp";
@@ -28,8 +28,8 @@ inline void DumpYamlConfig(const CortexConfig& config,
2828
}
2929
YAML::Node node;
3030
node["dataFolderPath"] = config.dataFolderPath;
31-
node["host"] = config.host;
32-
node["port"] = config.port;
31+
node["apiServerHost"] = config.apiServerHost;
32+
node["apiServerPort"] = config.apiServerPort;
3333

3434
out_file << node;
3535
out_file.close();
@@ -50,8 +50,8 @@ inline CortexConfig FromYaml(const std::string& path,
5050
auto node = YAML::LoadFile(config_file_path.string());
5151
CortexConfig config = {
5252
.dataFolderPath = node["dataFolderPath"].as<std::string>(),
53-
.host = node["host"].as<std::string>(),
54-
.port = node["port"].as<std::string>(),
53+
.apiServerHost = node["apiServerHost"].as<std::string>(),
54+
.apiServerPort = node["apiServerPort"].as<std::string>(),
5555
};
5656
return config;
5757
} catch (const YAML::BadFile& e) {
@@ -60,5 +60,4 @@ inline CortexConfig FromYaml(const std::string& path,
6060
}
6161
}
6262

63-
6463
} // namespace config_yaml_utils

engine/utils/file_manager_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ inline void CreateConfigFileIfNotExist() {
136136

137137
auto config = config_yaml_utils::CortexConfig{
138138
.dataFolderPath = defaultDataFolderPath.string(),
139-
.host = config_yaml_utils::kDefaultHost,
140-
.port = config_yaml_utils::kDefaultPort,
139+
.apiServerHost = config_yaml_utils::kDefaultHost,
140+
.apiServerPort = config_yaml_utils::kDefaultPort,
141141
};
142142
DumpYamlConfig(config, config_path.string());
143143
}

0 commit comments

Comments
 (0)