Skip to content

Commit

Permalink
chore: remove workspace test
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Jun 16, 2024
1 parent 29d36a2 commit f0bf576
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 257 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/client_api_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
working-directory: ./libs/client-api
run: cargo build --features "enable_brotli"

- name: Build ClientAPI WASM
working-directory: ./libs/client-api
run: wasm-pack build

- name: Check ClientAPI Dependencies
working-directory: ./libs/client-api
run: bash ../../script/client_api_deps_check.sh
Expand Down
2 changes: 1 addition & 1 deletion libs/client-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod http;
mod http_ai;
mod http_billing;
pub mod http_blob;

mod http_collab;
mod http_history;
mod http_member;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl FileDir for FileDirImpl<'_> {

#[cfg(test)]
mod tests {
use crate::http_blob::ChunkedBytes;
use crate::ChunkedBytes;
use bytes::Bytes;
use std::env::temp_dir;
use tokio::io::AsyncWriteExt;
Expand Down
2 changes: 2 additions & 0 deletions libs/client-api/src/native/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
mod http_blob;
mod http_native;
mod ping;
mod retry;

pub use http_blob::*;
#[allow(unused_imports)]
pub use http_native::*;
pub(crate) use ping::*;
Expand Down
156 changes: 0 additions & 156 deletions libs/client-api/src/wasm/http_wasm.rs

This file was deleted.

7 changes: 0 additions & 7 deletions libs/client-api/src/wasm/mod.rs

This file was deleted.

49 changes: 0 additions & 49 deletions libs/client-api/src/wasm/ping.rs

This file was deleted.

24 changes: 0 additions & 24 deletions libs/client-api/src/wasm/retry.rs

This file was deleted.

3 changes: 2 additions & 1 deletion libs/database/src/file/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use database_entity::file_dto::{
CompleteUploadRequest, CreateUploadRequest, CreateUploadResponse, FileDir, UploadPartRequest,
UploadPartResponse,
};
use tracing::{instrument, warn};
use tracing::{info, instrument, warn};
use uuid::Uuid;

pub trait ResponseBlob {
Expand Down Expand Up @@ -58,6 +58,7 @@ where
}

pub async fn remove_dir(&self, dir: &str) -> Result<(), AppError> {
info!("removing dir: {}", dir);
self.client.remove_dir(dir).await?;
Ok(())
}
Expand Down
25 changes: 23 additions & 2 deletions libs/database/src/file/s3_client_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ impl BucketClient for AwsS3BucketClientImpl {
})
.collect();

trace!(
"objects_to_delete: {:?} at directory: {}",
objects_to_delete.len(),
dir
);

// Step 2: Delete the listed objects in batches of 1000
while !objects_to_delete.is_empty() {
let batch = if objects_to_delete.len() > 1000 {
Expand All @@ -287,6 +293,15 @@ impl BucketClient for AwsS3BucketClientImpl {
Vec::new()
};

trace!(
"Deleting {} objects: {:?}",
dir,
objects_to_delete
.iter()
.map(|object| &object.key)
.collect::<Vec<&String>>()
);

let delete = Delete::builder()
.set_objects(Some(objects_to_delete))
.build()
Expand Down Expand Up @@ -314,9 +329,15 @@ impl BucketClient for AwsS3BucketClientImpl {
objects_to_delete = batch;
}

if list_objects.is_truncated.is_none() {
break;
match list_objects.is_truncated {
None => break,
Some(is_truncated) => {
if !is_truncated {
break;
}
},
}

continuation_token = list_objects.next_continuation_token;
}

Expand Down
Loading

0 comments on commit f0bf576

Please sign in to comment.