Skip to content

Commit

Permalink
fix: update proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Horbin-Magician committed Aug 23, 2024
1 parent 3f9a245 commit 5f21331
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/application/setting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ impl Setting {
let setting_win_clone = setting_win_clone.clone();
std::thread::spawn(move || {
net_util::Updater::global().lock().unwrap().update_software().unwrap_or_else(
|_| {
|e| {
println!("Failed to update software: {}", e);
setting_win_clone.upgrade_in_event_loop(move |setting_window| {
setting_window.set_block(false);
setting_window.set_update_state(2);
Expand Down
4 changes: 2 additions & 2 deletions src/core/util/net_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ impl Updater {
let zip_name = &asset.name;

let file_response = reqwest::blocking::Client::new()
.get(download_url).send()
.get(format!("https://mirror.ghproxy.com/{}", download_url)).send()
.or_else( |_| {
reqwest::blocking::Client::new().get(format!("mirror.ghproxy.com/{}", download_url)).send()
reqwest::blocking::Client::new().get(download_url).send()
}
)?;

Expand Down

0 comments on commit 5f21331

Please sign in to comment.