feat: Multiword rewrite while there is time

This commit is contained in:
Clément Renault 2019-08-18 18:58:38 +02:00
parent 7dc9ea78fa
commit 67302d09f3
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -239,6 +239,12 @@ fn multiword_rewrite_matches(
// for each attribute of each document // for each attribute of each document
for same_document_attribute in matches.linear_group_by_key(|(id, m)| (*id, m.attribute)) { for same_document_attribute in matches.linear_group_by_key(|(id, m)| (*id, m.attribute)) {
let elapsed = start.elapsed();
if elapsed > Duration::from_millis(10) {
info!("abort multiword rewrite after {:.2?}", elapsed);
break;
}
// padding will only be applied // padding will only be applied
// to word indices in the same attribute // to word indices in the same attribute
let mut padding = 0; let mut padding = 0;