Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: engines install pre-release #1577

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions engine/cli/commands/engine_install_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bool EngineInstallCmd::Exec(const std::string& engine,

httplib::Client cli(host_ + ":" + std::to_string(port_));
Json::Value json_data;
json_data["version"] = version.empty() ? "latest" : version;
auto data_str = json_data.toStyledString();
cli.set_read_timeout(std::chrono::seconds(60));
auto res = cli.Post("/v1/engines/install/" + engine, httplib::Headers(),
Expand Down
2 changes: 1 addition & 1 deletion engine/controllers/engines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void Engines::InstallEngine(
return;
}

auto version{"latest"};
auto version = (*(req->getJsonObject())).get("version", "latest").asString();
auto result = engine_service_->InstallEngineAsync(engine, version);
if (result.has_error()) {
Json::Value res;
Expand Down
Loading