From f4c35b546e7050d72e6d908261cba166ba96b8af Mon Sep 17 00:00:00 2001 From: Ericson Fogo Soares Date: Wed, 3 Jan 2024 18:43:48 -0300 Subject: [PATCH] More logs --- core/src/api/locations.rs | 7 +++++++ core/src/location/mod.rs | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs index 14acbb0ea..95fc55785 100644 --- a/core/src/api/locations.rs +++ b/core/src/api/locations.rs @@ -452,6 +452,9 @@ pub(crate) fn mount() -> AlphaRouter { location_id, sub_path, }: LightScanArgs| async move { + tracing::warn!( + "trying to light scan Location: " + ); if node .jobs .has_job_running(|job_identity| { @@ -462,6 +465,7 @@ pub(crate) fn mount() -> AlphaRouter { }) .await { + error!("Still indexing Location, wait a bit...: "); return Err(rspc::Error::new( ErrorCode::Conflict, "We're still indexing this location, pleases wait a bit...".to_string(), @@ -475,6 +479,9 @@ pub(crate) fn mount() -> AlphaRouter { .ok_or(LocationError::IdNotFound(location_id))?; let handle = tokio::spawn(async move { + tracing::warn!( + "spawning light scan Location: " + ); if let Err(e) = light_scan_location(node, library, location, sub_path).await { error!("light scan error: {e:#?}"); diff --git a/core/src/location/mod.rs b/core/src/location/mod.rs index b47d074a3..307e7c944 100644 --- a/core/src/location/mod.rs +++ b/core/src/location/mod.rs @@ -524,13 +524,31 @@ pub async fn light_scan_location( // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. if location.instance_id != Some(library.config().await.instance_id) { + warn!( + "Mismatched instance_id, will not light scan location: ", + location.id + ); return Ok(()); } let location_base_data = location::Data::from(&location); + tracing::warn!( + "shallow indexing Location: ", + location.id + ); indexer::shallow(&location, &sub_path, &node, &library).await?; + + tracing::warn!( + "shallow identifying Location: ", + location.id + ); file_identifier::shallow(&location_base_data, &sub_path, &library).await?; + + tracing::warn!( + "shallow media processing Location: ", + location.id + ); media_processor::shallow( &location_base_data, &sub_path, @@ -541,6 +559,11 @@ pub async fn light_scan_location( ) .await?; + tracing::warn!( + "light scan complete on Location: ", + location.id + ); + Ok(()) }