server: move notmuch refresh out of tantivy cfg block for refresh

This commit is contained in:
Bill Thiede 2024-12-17 13:57:06 -08:00
parent b9aaf87dc2
commit d7214f4f29

View File

@ -583,12 +583,12 @@ impl Mutation {
#[instrument(skip_all)]
async fn refresh<'ctx>(&self, ctx: &Context<'ctx>) -> Result<bool, Error> {
let nm = ctx.data_unchecked::<Notmuch>();
info!("{}", String::from_utf8_lossy(&nm.new()?));
#[cfg(feature = "tantivy")]
{
let tantivy = ctx.data_unchecked::<TantivyConnection>();
let pool = ctx.data_unchecked::<PgPool>();
// TODO: parallelize
info!("{}", String::from_utf8_lossy(&nm.new()?));
tantivy.refresh(pool).await?;
}
Ok(true)