Skip to content

Commit

Permalink
Some better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fogodev committed May 20, 2024
1 parent 29990de commit 63da1ea
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 173 deletions.
23 changes: 19 additions & 4 deletions core/crates/heavy-lifting/src/indexer/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ impl Indexer {

let (to_create_count, to_update_count) = (to_create.len(), to_update.len());

debug!("Scanned {directory_iso_file_path} in {scan_time:?}");

*self
.iso_paths_and_sizes
.entry(directory_iso_file_path)
Expand Down Expand Up @@ -447,6 +449,15 @@ impl Indexer {
})
.collect::<Vec<_>>();

debug!(
"Dispatching more ({}W/{}S/{}U) tasks, completed ({}/{})",
handles.len(),
save_tasks.len(),
update_tasks.len(),
self.metadata.completed_tasks,
self.metadata.total_tasks
);

handles.extend(dispatcher.dispatch_many(save_tasks).await);
handles.extend(dispatcher.dispatch_many(update_tasks).await);

Expand All @@ -460,8 +471,6 @@ impl Indexer {
])
.await;

debug!("Processed walk task in the indexer, took: {scan_time:?}");

Ok(handles)
}

Expand All @@ -478,7 +487,10 @@ impl Indexer {

ctx.progress_msg(format!("Saved {saved_count} files")).await;

debug!("Processed save task in the indexer, took: {save_duration:?}");
debug!(
"Processed save task in the indexer ({}/{}), took: {save_duration:?}",
self.metadata.completed_tasks, self.metadata.total_tasks
);
}

async fn process_update_output<OuterCtx: OuterContext>(
Expand All @@ -495,7 +507,10 @@ impl Indexer {
ctx.progress_msg(format!("Updated {updated_count} files"))
.await;

debug!("Processed update task in the indexer, took: {update_duration:?}");
debug!(
"Processed update task in the indexer ({}/{}), took: {update_duration:?}",
self.metadata.completed_tasks, self.metadata.total_tasks
);
}

async fn process_handles<OuterCtx: OuterContext>(
Expand Down
11 changes: 7 additions & 4 deletions core/src/location/manager/watcher/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,10 +1124,13 @@ pub(super) async fn recalculate_directories_size(
)
.await?;

error!(
"Reverse calculating directory sizes finished with {} non-critical errors: {non_critical_errors:#?}",
non_critical_errors.len()
);
if !non_critical_errors.is_empty() {
error!(
"Reverse calculating directory sizes finished with {} \
non-critical errors: {non_critical_errors:#?}",
non_critical_errors.len()
);
}

should_invalidate = true;
} else {
Expand Down
Loading

0 comments on commit 63da1ea

Please sign in to comment.