mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 12:43:01 -04:00
refactor(sdk): Clean up sync_with_callback implementation
This commit is contained in:
committed by
Jonas Platte
parent
1a50f42402
commit
ef462c786a
@@ -2448,12 +2448,13 @@ impl Client {
|
||||
C: Future<Output = LoopCtrl>,
|
||||
{
|
||||
self.sync_with_result_callback(sync_settings, |result| async {
|
||||
if let Ok(sync_response) = result {
|
||||
callback(sync_response).await
|
||||
} else {
|
||||
warn!("Error from sync with result: {}", result.err().unwrap());
|
||||
// do not make a decision about control loop by default
|
||||
LoopCtrl::Continue
|
||||
match result {
|
||||
Ok(sync_response) => callback(sync_response).await,
|
||||
Err(e) => {
|
||||
warn!("Error from sync with result: {e}");
|
||||
// continue the loop in case of error
|
||||
LoopCtrl::Continue
|
||||
}
|
||||
}
|
||||
})
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user