From 58d2d1e30db47a2a4c9468104a4d73adccf89115 Mon Sep 17 00:00:00 2001 From: Boshen Date: Mon, 21 Aug 2023 16:20:33 +0800 Subject: [PATCH] fix(cli): fix a race condition where the program will hang --- crates/oxc_linter/src/service.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/oxc_linter/src/service.rs b/crates/oxc_linter/src/service.rs index b8748bb9f..b3982b5bc 100644 --- a/crates/oxc_linter/src/service.rs +++ b/crates/oxc_linter/src/service.rs @@ -54,13 +54,13 @@ impl LintService { if !diagnostics.1.is_empty() { tx_error.send(Some(diagnostics)).unwrap(); } - - if done && processing.is_empty() { - tx_error.send(None).unwrap(); - break; - } } } + + if done && processing.is_empty() { + tx_error.send(None).unwrap(); + break; + } } }); }