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

Commit ee41d48

Browse files
authored
fix: engines install pre-release (#1577)
* fix: engines install pre-release * fix: add log for debugging * fix: handle empty body for engines install * fix: check not null
1 parent 6cda3ee commit ee41d48

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

engine/cli/commands/engine_install_cmd.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool EngineInstallCmd::Exec(const std::string& engine,
3333

3434
httplib::Client cli(host_ + ":" + std::to_string(port_));
3535
Json::Value json_data;
36+
json_data["version"] = version.empty() ? "latest" : version;
3637
auto data_str = json_data.toStyledString();
3738
cli.set_read_timeout(std::chrono::seconds(60));
3839
auto res = cli.Post("/v1/engines/install/" + engine, httplib::Headers(),

engine/cli/commands/model_pull_cmd.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ std::optional<std::string> ModelPullCmd::Exec(const std::string& host, int port,
100100
return std::nullopt;
101101
}
102102

103+
CTL_INF("model: " << model << ", model_id: " << model_id);
104+
103105
// Send request download model to server
104106
Json::Value json_data;
105107
json_data["model"] = model;

engine/controllers/engines.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ void Engines::InstallEngine(
2020
return;
2121
}
2222

23-
auto version{"latest"};
23+
std::string version = "latest";
24+
if (auto o = req->getJsonObject(); o) {
25+
version = (*o).get("version", "latest").asString();
26+
}
27+
2428
auto result = engine_service_->InstallEngineAsync(engine, version);
2529
if (result.has_error()) {
2630
Json::Value res;

0 commit comments

Comments
 (0)