server: move notmuch refresh out of tantivy cfg block for refresh
This commit is contained in:
parent
b9aaf87dc2
commit
d7214f4f29
@ -583,12 +583,12 @@ impl Mutation {
|
|||||||
#[instrument(skip_all)]
|
#[instrument(skip_all)]
|
||||||
async fn refresh<'ctx>(&self, ctx: &Context<'ctx>) -> Result<bool, Error> {
|
async fn refresh<'ctx>(&self, ctx: &Context<'ctx>) -> Result<bool, Error> {
|
||||||
let nm = ctx.data_unchecked::<Notmuch>();
|
let nm = ctx.data_unchecked::<Notmuch>();
|
||||||
|
info!("{}", String::from_utf8_lossy(&nm.new()?));
|
||||||
#[cfg(feature = "tantivy")]
|
#[cfg(feature = "tantivy")]
|
||||||
{
|
{
|
||||||
let tantivy = ctx.data_unchecked::<TantivyConnection>();
|
let tantivy = ctx.data_unchecked::<TantivyConnection>();
|
||||||
let pool = ctx.data_unchecked::<PgPool>();
|
let pool = ctx.data_unchecked::<PgPool>();
|
||||||
// TODO: parallelize
|
// TODO: parallelize
|
||||||
info!("{}", String::from_utf8_lossy(&nm.new()?));
|
|
||||||
tantivy.refresh(pool).await?;
|
tantivy.refresh(pool).await?;
|
||||||
}
|
}
|
||||||
Ok(true)
|
Ok(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user