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

Added quicksync version to the download urls #55

Merged
merged 3 commits into from
Oct 9, 2024
Merged
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
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
);
poszu marked this conversation as resolved.
Show resolved Hide resolved
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
Loading