Skip to content

Commit

Permalink
Added quicksync version to the download urls
Browse files Browse the repository at this point in the history
  • Loading branch information
pigmej committed Oct 9, 2024
1 parent 6b66b32 commit a037902
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/partial_quicksync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,19 @@ fn download_file(
.extension()
.is_some_and(|ext| ext == "zst")
.then_some(".zst");
let version = env!("CARGO_PKG_VERSION");
let url = format!("{}/{}", base_url, file_url(user_version, point, suffix));
let url_version = format!(
"{}/{}?version={}",
base_url,
file_url(user_version, point, suffix),
version
);
println!("Downloading from {}", url);
let mut resp = client.get(&url).send().context("Failed to send request")?;
let mut resp = client
.get(&url_version)
.send()
.context("Failed to send request")?;
if !resp.status().is_success() {
anyhow::bail!(
"Failed to download file {}: HTTP status {}",
Expand Down Expand Up @@ -162,7 +172,12 @@ pub fn partial_restore(
);

let restore_string = client
.get(format!("{}/{}/restore.sql", base_url, user_version))
.get(format!(
"{}/{}/restore.sql?version={}",
base_url,
user_version,
env!("CARGO_PKG_VERSION")
))
.send()?
.text()?;

Expand Down

0 comments on commit a037902

Please sign in to comment.