Skip to content

Commit

Permalink
feat: parallel item fetching & Some more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRacci committed Jun 22, 2023
1 parent 22a6cc0 commit 213ad05
Show file tree
Hide file tree
Showing 9 changed files with 370 additions and 160 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/backup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ futures = "0.3.28" # Needed by opendal
tokio-util = { version = "0.7.8", features = ["full"] }
futures-util = "0.3.28"
const_format = "0.2.31"
rayon = "1.7"

# For downloading the required cli
bytes = "1.4.0"
Expand Down
11 changes: 7 additions & 4 deletions crates/backup/src/sources/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ use crate::sources::download;
use crate::sources::exporter::Exporter;
use async_trait::async_trait;
use futures_util::StreamExt;
use indicatif::{MultiProgress, ProgressBar};
use lib::anyhow::{anyhow, Context, Result};
use lib::fs::create_parents;
use tracing::{debug, trace};
use lib::{anyhow, progress};
use std::fs::{metadata, set_permissions, File};
use std::fs::File;
use std::io::copy;
use std::path::PathBuf;
use std::process::Command;
use tracing::{debug, trace};

use indicatif::{MultiProgress, ProgressBar};
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use {
std::fs::{metadata, set_permissions},
std::os::unix::fs::PermissionsExt,
};

#[async_trait]
pub trait Downloader: Exporter {
Expand Down
Loading

0 comments on commit 213ad05

Please sign in to comment.