From 5d7eb2e99c80bfb7ee8208566c33d688409f4aeb Mon Sep 17 00:00:00 2001 From: vansangpfiev Date: Fri, 20 Sep 2024 08:13:35 +0700 Subject: [PATCH] fix: set timeout for checking new update --- engine/commands/cortex_upd_cmd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/commands/cortex_upd_cmd.h b/engine/commands/cortex_upd_cmd.h index 4a94ba01a..11931a5cb 100644 --- a/engine/commands/cortex_upd_cmd.h +++ b/engine/commands/cortex_upd_cmd.h @@ -15,6 +15,7 @@ constexpr const auto kNightlyFileName = "cortex-nightly.tar.gz"; const std::string kCortexBinary = "cortex"; constexpr const auto kBetaComp = "-rc"; constexpr const auto kReleaseFormat = ".tar.gz"; +constexpr const auto kTimeoutCheckUpdate = std::chrono::milliseconds(1000); inline std::string GetCortexBinary() { #if defined(_WIN32) @@ -56,6 +57,7 @@ inline void CheckNewUpdate() { CTL_INF("Engine release path: " << host_name << release_path); httplib::Client cli(host_name); + cli.set_connection_timeout(kTimeoutCheckUpdate); if (auto res = cli.Get(release_path)) { if (res->status == httplib::StatusCode::OK_200) { try {