Skip to content

Commit

Permalink
spi-object: support check key exists (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzIsGod1019 authored Jun 13, 2024
1 parent 42596c7 commit 37ff11e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ strum = { version = "0.26", features = ["derive"] }
# tardis
# tardis = { version = "0.1.0-rc.15" }
# tardis = { path = "../tardis/tardis" }
tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "47a82de" }
tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "3316ce3" }
#spacegate

# spacegate-shell = { path = "../spacegate/crates/shell", features = [
Expand Down
1 change: 0 additions & 1 deletion backend/middlewares/flow/src/api/cc/flow_cc_inst_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ impl FlowCcInstApi {
ctx: TardisContextExtractor,
_request: &Request,
) -> TardisApiResult<Void> {
let mut funs = flow_constants::get_tardis_inst();
FlowInstServ::modify_current_vars(&flow_inst_id.0, &modify_req.0.vars, &ctx.0).await?;
TardisResp::ok(Void {})
}
Expand Down
2 changes: 2 additions & 0 deletions backend/middlewares/flow/src/serv/flow_rel_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub struct FlowRelServ;
#[derive(Display, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, strum::EnumString)]
pub enum FlowRelKind {
FlowModelState,
FlowModelFeedTemplate,
FlowModelProjTemplate,
}

impl FlowRelServ {
Expand Down
2 changes: 1 addition & 1 deletion backend/spi/spi-object/src/api/ci/object_ci_obj_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl ObjectCiObjApi {
}

/// Complete Multipart Upload Task
#[oai(path = "/multi_upload/batch_build_create_presign_url", method = "post")]
#[oai(path = "/multi_upload/complete_multipart_upload", method = "post")]
async fn complete_multipart_upload(&self, req: Json<ObjectCompleteMultipartUploadReq>, ctx: TardisContextExtractor) -> TardisApiResult<Void> {
let funs = crate::get_tardis_inst();
object_obj_serv::complete_multipart_upload(req.0, &funs, &ctx.0).await?;
Expand Down
9 changes: 1 addition & 8 deletions backend/spi/spi-object/src/serv/s3/object_s3_obj_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,7 @@ pub async fn object_exist(object_path: &str, private: Option<bool>, special: Opt
let bs_inst = inst.inst::<TardisOSClient>();
let client = bs_inst.0;
let bucket_name = get_bucket_name(private, special, inst);
let result = client.object_get(object_path, bucket_name.as_deref()).await;
if result.is_err() && result.clone().expect_err("unreachable").code == "404" {
Ok(false)
} else if result.is_ok() {
Ok(true)
} else {
result.map(|_| true)
}
client.object_exist(object_path, bucket_name.as_deref()).await
}

pub async fn batch_get_presign_obj_url(
Expand Down

0 comments on commit 37ff11e

Please sign in to comment.