mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-06 09:12:55 +00:00
Removes all usage of block_on, and use a oneshot channel instead. (#1315)
* Removes all usage of block_on, and use a oneshot channel instead. Calling `block_on` panics in certain context. For instance, it panics when it is called in a the context of another call to block. Using it in tantivy is unnecessary. We replace it by a thin wrapper around a oneshot channel that supports both async/sync. * Removing needless uses of async in the API. Co-authored-by: PSeitz <PSeitz@users.noreply.github.com>
This commit is contained in:
@@ -125,7 +125,6 @@ impl Scorer for TermScorer {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use futures::executor::block_on;
|
||||
use proptest::prelude::*;
|
||||
|
||||
use crate::merge_policy::NoMergePolicy;
|
||||
@@ -321,9 +320,7 @@ mod tests {
|
||||
.collect();
|
||||
test_block_wand_aux(&term_query, &searcher)?;
|
||||
}
|
||||
{
|
||||
let _ = block_on(writer.merge(&segment_ids[..]));
|
||||
}
|
||||
writer.merge(&segment_ids[..]).wait().unwrap();
|
||||
{
|
||||
reader.reload()?;
|
||||
let searcher = reader.searcher();
|
||||
|
||||
Reference in New Issue
Block a user