From 21e3e63ac3eb6d141a845d38be78f48f3c38b308 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 25 Sep 2022 18:46:50 -0500 Subject: [PATCH] Instrument upload store methods --- src/repo/sled.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/repo/sled.rs b/src/repo/sled.rs index 75a9171..c2d0472 100644 --- a/src/repo/sled.rs +++ b/src/repo/sled.rs @@ -281,11 +281,13 @@ impl CachedRepo for SledRepo { #[async_trait::async_trait(?Send)] impl UploadRepo for SledRepo { + #[tracing::instrument(skip(self))] async fn create(&self, upload_id: UploadId) -> Result<(), Error> { b!(self.uploads, uploads.insert(upload_id.as_bytes(), b"1")); Ok(()) } + #[tracing::instrument(skip(self))] async fn wait(&self, upload_id: UploadId) -> Result { let mut subscriber = self.uploads.watch_prefix(upload_id.as_bytes()); @@ -318,11 +320,13 @@ impl UploadRepo for SledRepo { Err(UploadError::Canceled.into()) } + #[tracing::instrument(skip(self))] async fn claim(&self, upload_id: UploadId) -> Result<(), Error> { b!(self.uploads, uploads.remove(upload_id.as_bytes())); Ok(()) } + #[tracing::instrument(skip(self, result))] async fn complete(&self, upload_id: UploadId, result: UploadResult) -> Result<(), Error> { let result: InnerUploadResult = result.into(); let result = serde_json::to_vec(&result)?;