server: improve tantivy performance by reusing IndexReader

Also improve a bunch of trace logging
This commit is contained in:
2024-12-15 14:46:10 -08:00
parent 05cdcec244
commit 6d8b2de608
5 changed files with 67 additions and 42 deletions

View File

@@ -505,7 +505,7 @@ async fn tantivy_search(
pub struct Mutation;
#[Object]
impl Mutation {
#[instrument(skip_all, fields(query, bool))]
#[instrument(skip_all, fields(query=query, unread=unread))]
async fn set_read_status<'ctx>(
&self,
ctx: &Context<'ctx>,
@@ -522,7 +522,7 @@ impl Mutation {
nm::set_read_status(nm, &query, unread).await?;
Ok(true)
}
#[instrument(skip_all, fields(query, tag))]
#[instrument(skip_all, fields(query=query, tag=tag))]
async fn tag_add<'ctx>(
&self,
ctx: &Context<'ctx>,
@@ -534,7 +534,7 @@ impl Mutation {
nm.tag_add(&tag, &query)?;
Ok(true)
}
#[instrument(skip_all, fields(query, tag))]
#[instrument(skip_all, fields(query=query, tag=tag))]
async fn tag_remove<'ctx>(
&self,
ctx: &Context<'ctx>,