Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3337331
D13648.id45164.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13648.id45164.diff
View Options
diff --git a/shared/comm-lib/src/blob/client.rs b/shared/comm-lib/src/blob/client.rs
--- a/shared/comm-lib/src/blob/client.rs
+++ b/shared/comm-lib/src/blob/client.rs
@@ -21,7 +21,7 @@
},
};
-use super::types::{http::RemoveHoldersResponse, BlobInfo};
+use super::types::http::RemoveHoldersResponse;
#[derive(From, Error, Debug, Display)]
pub enum BlobServiceError {
@@ -242,25 +242,29 @@
/// successfully removed.
/// - If one or more removal failed server-side, these will be returned
/// in the `failed_requests` response field. It has the same format
- /// as this function input and can be directly used to retry removal.
+ /// as this function input and can be directly used to retry removal,
+ /// by calling `remove_multiple_holders(failed_requests.into()).await`
///
/// For single holder removal, see [`BlobServiceClient::revoke_holder`].
pub async fn remove_multiple_holders(
&self,
- blob_infos: Vec<BlobInfo>,
+ request: RemoveHoldersRequest,
) -> BlobResult<RemoveHoldersResponse> {
- let num_holders = blob_infos.len();
- debug!(num_holders, "Revoke multiple holders request.");
+ match &request {
+ RemoveHoldersRequest::Items { requests, .. } => {
+ let num_holders = requests.len();
+ debug!(num_holders, "Remove multiple holders request.");
+ }
+ RemoveHoldersRequest::ByIndexedTags { tags } => {
+ debug!("Remove holders request for {} tags.", tags.len());
+ }
+ }
let url = self.get_holders_url()?;
- let payload = RemoveHoldersRequest::Items {
- requests: blob_infos,
- instant_delete: false,
- };
- trace!("Request payload: {:?}", payload);
+ trace!("Request payload: {:?}", request);
let response = self
.request(Method::DELETE, url)?
- .json(&payload)
+ .json(&request)
.send()
.await?;
diff --git a/shared/comm-lib/src/blob/types.rs b/shared/comm-lib/src/blob/types.rs
--- a/shared/comm-lib/src/blob/types.rs
+++ b/shared/comm-lib/src/blob/types.rs
@@ -83,6 +83,16 @@
#[serde(default)]
pub instant_delete: bool,
}
+
+ // impls
+ impl From<Vec<BlobInfo>> for RemoveHoldersRequest {
+ fn from(requests: Vec<BlobInfo>) -> Self {
+ Self::Items {
+ requests,
+ instant_delete: false,
+ }
+ }
+ }
}
/// Blob owning information - stores both blob_hash and holder
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 4:23 PM (16 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2561338
Default Alt Text
D13648.id45164.diff (2 KB)
Attached To
Mode
D13648: [comm-lib][blob-client] Add support for removing holders by tags
Attached
Detach File
Event Timeline
Log In to Comment