fix(android): recover from input stream failures
This commit is contained in:
@@ -459,10 +459,18 @@ pub async fn connect(
|
||||
identity: None,
|
||||
ready_timeout: Duration::from_secs(15),
|
||||
};
|
||||
let snap = runtime()
|
||||
let snap = match runtime()
|
||||
.spawn(async move { session().connect(cfg).await })
|
||||
.await
|
||||
.map_err(|e| task_join_error("connect", e))??;
|
||||
.map_err(|e| task_join_error("connect", e))?
|
||||
{
|
||||
Ok(snap) => snap,
|
||||
Err(chanora_core::CoreError::AlreadyConnected) => runtime()
|
||||
.spawn(async { session().snapshot().await })
|
||||
.await
|
||||
.map_err(|e| task_join_error("connect.snapshot", e))??,
|
||||
Err(e) => return Err(e.into()),
|
||||
};
|
||||
Ok(snap.into())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user