forked from akanyan/STARTLINER
fix: CLI deadlock
This commit is contained in:
@ -23,6 +23,7 @@ pub async fn startline(app: AppHandle) -> Result<(), String> {
|
||||
hash = appd.sum_packages(p);
|
||||
}
|
||||
if let Some(p) = &mut appd.profile {
|
||||
log::debug!("{}", hash);
|
||||
p.line_up(app.clone(), hash).await
|
||||
.map_err(|e| format!("Lineup failed:\n{}", e))?;
|
||||
p.start(app.clone()).await
|
||||
|
@ -127,10 +127,12 @@ pub async fn run(_args: Vec<String>) {
|
||||
let apph = apph.clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
let mtx = apph.state::<Mutex<AppData>>();
|
||||
let mut appd = mtx.lock().await;
|
||||
if let Err(e) = appd.pkgs.reload_all().await {
|
||||
log::error!("Unable to reload packages: {}", e);
|
||||
apph.exit(1);
|
||||
{
|
||||
let mut appd = mtx.lock().await;
|
||||
if let Err(e) = appd.pkgs.reload_all().await {
|
||||
log::error!("Unable to reload packages: {}", e);
|
||||
apph.exit(1);
|
||||
}
|
||||
}
|
||||
if let Err(e) = cmd::startline(apph.clone()).await {
|
||||
log::error!("Unable to launch: {}", e);
|
||||
|
Reference in New Issue
Block a user