Ignore SendErrors when handling grammars (#2641)

When handling grammars, fetching and building is done in a thread
pool.  Results are communicated over channels and the receiving
channel is closed on first error. This causes subsequent sends to
fail causing a mess in stderr. This ignores all SendErrors causing
only the first error to be printed.
imgbot
Frojdholm 2 years ago committed by GitHub
parent 378f438fb0
commit f7c27b604f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -133,7 +133,9 @@ where
let tx = tx.clone();
pool.execute(move || {
tx.send(job(grammar)).unwrap();
// Ignore any SendErrors, if any job in another thread has encountered an
// error the Receiver will be closed causing this send to fail.
let _ = tx.send(job(grammar));
});
}

Loading…
Cancel
Save