Add more tracing

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 9e0c72bd66
commit c087f2d281

@ -53,6 +53,7 @@ pub enum NegatableComparator<T> {
IsNot(T), IsNot(T),
} }
#[tracing::instrument(level = "debug")]
pub fn build_find_filter_conditions(filters: Vec<Vec<FilterProperty>>) -> Condition { pub fn build_find_filter_conditions(filters: Vec<Vec<FilterProperty>>) -> Condition {
filters filters
.into_iter() .into_iter()

@ -10,6 +10,7 @@ use mediarepo_model::file::{File, FileStatus};
use mediarepo_model::repo::Repo; use mediarepo_model::repo::Repo;
use std::collections::HashMap; use std::collections::HashMap;
#[tracing::instrument(level = "debug", skip(repo))]
pub async fn find_files_for_filters( pub async fn find_files_for_filters(
repo: &Repo, repo: &Repo,
expressions: Vec<FilterExpression>, expressions: Vec<FilterExpression>,
@ -21,6 +22,7 @@ pub async fn find_files_for_filters(
repo.find_files_by_filters(filters).await repo.find_files_by_filters(filters).await
} }
#[tracing::instrument(level = "debug")]
fn get_tag_names_from_expressions(expressions: &Vec<FilterExpression>) -> Vec<String> { fn get_tag_names_from_expressions(expressions: &Vec<FilterExpression>) -> Vec<String> {
expressions expressions
.iter() .iter()
@ -44,6 +46,7 @@ fn get_tag_names_from_expressions(expressions: &Vec<FilterExpression>) -> Vec<St
.collect::<Vec<String>>() .collect::<Vec<String>>()
} }
#[tracing::instrument(level = "debug")]
fn build_filters_from_expressions( fn build_filters_from_expressions(
expressions: Vec<FilterExpression>, expressions: Vec<FilterExpression>,
tag_id_map: &HashMap<String, i64>, tag_id_map: &HashMap<String, i64>,

@ -24,6 +24,7 @@ pub struct FileSortContext {
change_time: NaiveDateTime, change_time: NaiveDateTime,
} }
#[tracing::instrument(level = "debug", skip(repo, files))]
pub async fn sort_files_by_properties( pub async fn sort_files_by_properties(
repo: &Repo, repo: &Repo,
sort_expression: Vec<SortKey>, sort_expression: Vec<SortKey>,

Loading…
Cancel
Save