Page MenuHomePhabricator

D6204.id21086.diff
No OneTemporary

D6204.id21086.diff

diff --git a/services/backup/src/service/handlers/add_attachments.rs b/services/backup/src/service/handlers/add_attachments.rs
new file mode 100644
--- /dev/null
+++ b/services/backup/src/service/handlers/add_attachments.rs
@@ -0,0 +1,11 @@
+use tonic::Status;
+
+use super::proto;
+use crate::database::DatabaseClient;
+
+pub async fn handle_add_attachments(
+ db: &DatabaseClient,
+ request: proto::AddAttachmentsRequest,
+) -> Result<(), Status> {
+ unimplemented!()
+}
diff --git a/services/backup/src/service/mod.rs b/services/backup/src/service/mod.rs
--- a/services/backup/src/service/mod.rs
+++ b/services/backup/src/service/mod.rs
@@ -18,6 +18,7 @@
/// submodule containing gRPC endpoint handler implementations
mod handlers {
+ pub(super) mod add_attachments;
pub(super) mod create_backup;
// re-exports for convenient usage in handlers
@@ -139,12 +140,28 @@
Err(Status::unimplemented("unimplemented"))
}
- #[instrument(skip(self))]
+ #[instrument(skip_all,
+ fields(
+ backup_id = &request.get_ref().backup_id,
+ log_id = &request.get_ref().log_id)
+ )]
async fn add_attachments(
&self,
- _request: Request<proto::AddAttachmentsRequest>,
+ request: Request<proto::AddAttachmentsRequest>,
) -> Result<Response<()>, Status> {
- Err(Status::unimplemented("unimplemented"))
+ info!(
+ "AddAttachment request. New holders: {}",
+ &request.get_ref().holders
+ );
+
+ handlers::add_attachments::handle_add_attachments(
+ &self.db,
+ request.into_inner(),
+ )
+ .await?;
+
+ info!("Request processed successfully");
+ Ok(Response::new(()))
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 3:31 AM (18 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684965
Default Alt Text
D6204.id21086.diff (1 KB)

Event Timeline