feat(castore/fs): optional refscanner for ingest

Change-Id: Ieca06de4c2e2680d89fe05a380079fafa5454837
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12529
Autosubmit: yuka <yuka@yuka.dev>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
Yureka 2024-09-27 21:32:17 +02:00 committed by clbot
parent d277bd9fbf
commit b82cacb449
5 changed files with 60 additions and 22 deletions

View file

@ -339,10 +339,11 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error + Send + Sync
async move {
// Ingest the given path.
ingest_path(
ingest_path::<_, _, _, &[u8]>(
blob_service,
directory_service,
PathBuf::from(elem.path.to_absolute_path()),
None,
)
.await
.map(|root_node| (elem, root_node))

View file

@ -123,9 +123,10 @@ where
PS: AsRef<dyn PathInfoService>,
NS: NarCalculationService,
{
let root_node = ingest_path(blob_service, directory_service, path.as_ref())
.await
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
let root_node =
ingest_path::<_, _, _, &[u8]>(blob_service, directory_service, path.as_ref(), None)
.await
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
// Ask for the NAR size and sha256
let (nar_size, nar_sha256) = nar_calculation_service.calculate_nar(&root_node).await?;