Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Aug 18, 2024
2 parents d5b217d + b1b5cba commit f867407
Show file tree
Hide file tree
Showing 8 changed files with 367 additions and 41 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ env:
CARGO_TERM_COLOR: always

jobs:
test:
check_fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: clechasseur/rs-fmt-check@v2

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Get Dependencies
run: |
sudo apt-get update
Expand Down
41 changes: 20 additions & 21 deletions Cargo.lock

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

9 changes: 8 additions & 1 deletion fl-server/src/serve_flists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ pub async fn visit_dir_one_level(
None => progress = 100.0,
}

let ext = child.path().extension().unwrap().to_string_lossy().to_string();
let ext = child
.path()
.extension()
.unwrap()
.to_string_lossy()
.to_string();
if ext != "fl" {
continue;
}
Expand All @@ -118,6 +123,7 @@ pub async fn visit_dir_one_level(
name,
path_uri,
is_file,
size: child.metadata().await?.len(),
last_modified: child
.metadata()
.await?
Expand Down Expand Up @@ -179,6 +185,7 @@ pub struct FileInfo {
pub name: String,
pub path_uri: String,
pub is_file: bool,
pub size: u64,
pub last_modified: i64,
pub progress: f32,
}
Expand Down
3 changes: 1 addition & 2 deletions rfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ path = "src/lib.rs"

[dependencies]
anyhow = "1.0.44"
time = "0.3.3"
time = "0.3"
sqlx = { version = "0.7.4", features = [ "runtime-tokio-rustls", "sqlite" ] }
tokio = { version = "1", features = [ "rt", "rt-multi-thread", "macros"] }
libc = "0.2"
Expand All @@ -44,7 +44,6 @@ url = "2.3.1"
blake2b_simd = "1"
aes-gcm = "0.10"
hex = "0.4"
lazy_static = "1.4"
rand = "0.8"
# next are only needed for the binarys
clap = { version = "4.2", features = ["derive"], optional = true}
Expand Down
34 changes: 19 additions & 15 deletions rfs/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ pub async fn make<U: AsRef<str>>(u: U) -> Result<Stores> {
let parsed = url::Url::parse(u.as_ref())?;

match parsed.scheme() {
dir::SCHEME => return Ok(Stores::Dir(
dir::DirStore::make(&u)
.await
.expect("failed to make dir store"),
)),
"s3" | "s3s" | "s3s+tls" => return Ok(Stores::S3(
s3store::S3Store::make(&u)
.await
.expect(format!("failed to make {} store", parsed.scheme()).as_str()),
)),
"zdb" => return Ok(Stores::ZDB(
zdb::ZdbStore::make(&u)
.await
.expect("failed to make zdb store"),
)),
dir::SCHEME => {
return Ok(Stores::Dir(
dir::DirStore::make(&u)
.await
.expect("failed to make dir store"),
))
}
"s3" | "s3s" | "s3s+tls" => {
return Ok(Stores::S3(s3store::S3Store::make(&u).await.expect(
format!("failed to make {} store", parsed.scheme()).as_str(),
)))
}
"zdb" => {
return Ok(Stores::ZDB(
zdb::ZdbStore::make(&u)
.await
.expect("failed to make zdb store"),
))
}
_ => return Err(Error::UnknownStore(parsed.scheme().into())),
}
}
Expand Down
Loading

0 comments on commit f867407

Please sign in to comment.