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

Commit 6dc872d

Browse files
committed
fix downloading engines with progress bar
1 parent 9f55098 commit 6dc872d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

engine/cli/commands/engine_install_cmd.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ bool EngineInstallCmd::Exec(const std::string& engine,
3535
DownloadProgress dp;
3636
dp.Connect(host_, port_);
3737
// engine can be small, so need to start ws first
38-
auto dp_res = std::async(std::launch::deferred,
39-
[&dp, &engine] { return dp.Handle(engine); });
38+
auto dp_res = std::async(std::launch::deferred, [&dp, &engine] {
39+
return dp.Handle(DownloadType::Engine);
40+
});
4041
CLI_LOG("Validating download items, please wait..")
4142

4243
auto versions_url = url_parser::Url{
@@ -118,7 +119,7 @@ bool EngineInstallCmd::Exec(const std::string& engine,
118119

119120
bool check_cuda_download = !system_info_utils::GetCudaVersion().empty();
120121
if (check_cuda_download) {
121-
if (!dp.Handle("cuda"))
122+
if (!dp.Handle(DownloadType::CudaToolkit))
122123
return false;
123124
}
124125

@@ -130,9 +131,8 @@ bool EngineInstallCmd::Exec(const std::string& engine,
130131
DownloadProgress dp;
131132
dp.Connect(host_, port_);
132133
// engine can be small, so need to start ws first
133-
auto dp_res = std::async(std::launch::deferred, [&dp] {
134-
return dp.Handle(DownloadType::Engine);
135-
});
134+
auto dp_res = std::async(std::launch::deferred,
135+
[&dp] { return dp.Handle(DownloadType::Engine); });
136136
CLI_LOG("Validating download items, please wait..")
137137

138138
auto install_url = url_parser::Url{

engine/cli/commands/engine_update_cmd.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ bool EngineUpdateCmd::Exec(const std::string& host, int port,
2323
DownloadProgress dp;
2424
dp.Connect(host, port);
2525
// engine can be small, so need to start ws first
26-
auto dp_res = std::async(std::launch::deferred,
27-
[&dp, &engine] { return dp.Handle(engine); });
26+
auto dp_res = std::async(std::launch::deferred, [&dp, &engine] {
27+
return dp.Handle(DownloadType::Engine);
28+
});
2829
CLI_LOG("Validating download items, please wait..")
2930

3031
auto update_url = url_parser::Url{
@@ -43,7 +44,7 @@ bool EngineUpdateCmd::Exec(const std::string& host, int port,
4344

4445
bool check_cuda_download = !system_info_utils::GetCudaVersion().empty();
4546
if (check_cuda_download) {
46-
if (!dp.Handle("cuda"))
47+
if (!dp.Handle(DownloadType::CudaToolkit))
4748
return false;
4849
}
4950

0 commit comments

Comments
 (0)