feat(http): implement is_indexing for stats

This commit is contained in:
Alexey Shekhirin 2021-04-02 14:44:35 +03:00
parent 09d9a29176
commit 87412f63ef
No known key found for this signature in database
GPG key ID: AF9A26AA133B5B98
9 changed files with 65 additions and 22 deletions

View file

@ -354,7 +354,13 @@ impl IndexController {
pub async fn get_stats(&self, uid: String) -> anyhow::Result<IndexStats> {
let uuid = self.uuid_resolver.get(uid.clone()).await?;
Ok(self.index_handle.get_index_stats(uuid).await?)
let stats = self.index_handle.get_index_stats(uuid);
let is_indexing = self.update_handle.is_locked(uuid);
Ok(IndexStats {
is_indexing: is_indexing.await?,
..stats.await?
})
}
}