2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Generate details during ingest

This commit is contained in:
asonix 2023-09-24 12:58:16 -05:00
parent 8f62b0c325
commit f3ef2d870b

View file

@ -2,6 +2,7 @@ use std::{sync::Arc, time::Duration};
use crate::{ use crate::{
bytes_stream::BytesStream, bytes_stream::BytesStream,
details::Details,
error::{Error, UploadError}, error::{Error, UploadError},
formats::{InternalFormat, Validations}, formats::{InternalFormat, Validations},
future::WithMetrics, future::WithMetrics,
@ -105,6 +106,8 @@ where
.save_async_read(hasher_reader, input_type.media_type()) .save_async_read(hasher_reader, input_type.media_type())
.await?; .await?;
let details = Details::from_store(store, &identifier, media.process_timeout).await?;
drop(permit); drop(permit);
let mut session = Session { let mut session = Session {
@ -139,6 +142,8 @@ where
save_upload(&mut session, repo, store, hash.clone(), &identifier).await?; save_upload(&mut session, repo, store, hash.clone(), &identifier).await?;
repo.relate_details(&identifier, &details).await?;
if let Some(alias) = declared_alias { if let Some(alias) = declared_alias {
session.add_existing_alias(hash, alias).await? session.add_existing_alias(hash, alias).await?
} else { } else {