mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Introduce an Index mathod to retrieve the currently processed update
This commit is contained in:
parent
c9618793e3
commit
3278d22279
@ -23,8 +23,7 @@ fn update_awaiter(
|
|||||||
rkv: Arc<RwLock<rkv::Rkv>>,
|
rkv: Arc<RwLock<rkv::Rkv>>,
|
||||||
update_fn: Arc<ArcSwapFn>,
|
update_fn: Arc<ArcSwapFn>,
|
||||||
index: Index,
|
index: Index,
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
for () in receiver {
|
for () in receiver {
|
||||||
// consume all updates in order (oldest first)
|
// consume all updates in order (oldest first)
|
||||||
loop {
|
loop {
|
||||||
|
@ -186,6 +186,13 @@ impl Index {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn current_update_id<T: rkv::Readable>(&self, reader: &T) -> MResult<Option<u64>> {
|
||||||
|
match self.updates.last_update_id(reader)? {
|
||||||
|
Some((id, _)) => Ok(Some(id)),
|
||||||
|
None => Ok(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_status<T: rkv::Readable>(
|
pub fn update_status<T: rkv::Readable>(
|
||||||
&self,
|
&self,
|
||||||
reader: &T,
|
reader: &T,
|
||||||
|
Loading…
Reference in New Issue
Block a user