diff --git a/src/bin/repo.rs b/src/bin/repo.rs index 4b54cfcb7..341cd0e72 100644 --- a/src/bin/repo.rs +++ b/src/bin/repo.rs @@ -293,14 +293,10 @@ fn repo_inner( app.dump_logs_anyway = true; let th = thread::spawn(move || { while let Ok(update) = status_rx.recv() { - let mut should_break = false; - if let StatusUpdate::FlushLog(_p, _q) = &update { - should_break = true; - } - app.update_status(update); - if should_break { + if update == StatusUpdate::CookThreadFinished { break; } + app.update_status(update); } }); let mut logger = Some((&mut stdout_writer, &mut stderr_writer)); @@ -316,6 +312,9 @@ fn repo_inner( .send(StatusUpdate::FlushLog(recipe.name.clone(), log_path)) .unwrap_or_default(); } + status_tx + .send(StatusUpdate::CookThreadFinished) + .unwrap_or_default(); let _ = th.join(); } CliCommand::Unfetch => handle_clean(recipe, config, true, true)?,