mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
Use with tokio channel in Meilisearch
This commit is contained in:
parent
07263bc0d7
commit
20c75aa85c
@ -57,13 +57,13 @@ fn setup(opt: &Opt) -> anyhow::Result<()> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
tokio::task::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
trace.flush().unwrap();
|
match tokio::time::timeout(std::time::Duration::from_secs(1), trace.receive()).await {
|
||||||
match trace.receive() {
|
Ok(Ok(ControlFlow::Continue(()))) => continue,
|
||||||
Ok(ControlFlow::Continue(_)) => continue,
|
Ok(Ok(ControlFlow::Break(_))) => break,
|
||||||
Ok(ControlFlow::Break(_)) => break,
|
Ok(Err(_)) => todo!(),
|
||||||
Err(_) => todo!(),
|
Err(_) => trace.flush().unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while trace.try_receive().is_ok() {}
|
while trace.try_receive().is_ok() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user