diff options
Diffstat (limited to 'tvix/store/src/pathinfoservice/lru.rs')
-rw-r--r-- | tvix/store/src/pathinfoservice/lru.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tvix/store/src/pathinfoservice/lru.rs b/tvix/store/src/pathinfoservice/lru.rs index f3790a9054fd..da674f497ad6 100644 --- a/tvix/store/src/pathinfoservice/lru.rs +++ b/tvix/store/src/pathinfoservice/lru.rs @@ -1,11 +1,12 @@ -use std::num::NonZeroUsize; -use std::sync::Arc; -use tokio::sync::RwLock; - use async_stream::try_stream; use futures::stream::BoxStream; use lru::LruCache; +use nix_compat::nixbase32; +use std::num::NonZeroUsize; +use std::sync::Arc; +use tokio::sync::RwLock; use tonic::async_trait; +use tracing::instrument; use crate::proto::PathInfo; use tvix_castore::Error; @@ -26,10 +27,12 @@ impl LruPathInfoService { #[async_trait] impl PathInfoService for LruPathInfoService { + #[instrument(level = "trace", skip_all, fields(path_info.digest = nixbase32::encode(&digest)))] async fn get(&self, digest: [u8; 20]) -> Result<Option<PathInfo>, Error> { Ok(self.lru.write().await.get(&digest).cloned()) } + #[instrument(level = "trace", skip_all, fields(path_info.root_node = ?path_info.node))] async fn put(&self, path_info: PathInfo) -> Result<PathInfo, Error> { // call validate let store_path = path_info |