Skip to content

Commit

Permalink
chore(event cache): add more logs when the event cache tasks are shut…
Browse files Browse the repository at this point in the history
…ting down
  • Loading branch information
bnjbvr committed Jan 9, 2025
1 parent 9e97ed3 commit fb54e86
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/matrix-sdk/src/event_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,12 @@ impl EventCache {

async move {
while ignore_user_list_stream.next().await.is_some() {
info!("received an ignore user list change");
info!("Received an ignore user list change");
if let Err(err) = inner.clear_all_rooms().await {
error!("error when clearing room storage: {err}");
error!("when clearing room storage after ignore user list change: {err}");
}
}
info!("Ignore user list stream has closed");
}
.instrument(span)
.await;
Expand All @@ -271,6 +272,7 @@ impl EventCache {
match err {
EventCacheError::ClientDropped => {
// The client has dropped, exit the listen task.
info!("Closing the event cache global listen task because client dropped");
break;
}
err => {
Expand All @@ -286,12 +288,13 @@ impl EventCache {
// TODO: implement Smart Matching™,
warn!(num_skipped, "Lagged behind room updates, clearing all rooms");
if let Err(err) = inner.clear_all_rooms().await {
error!("error when clearing storage: {err}");
error!("when clearing storage after lag in listen_task: {err}");
}
}

Err(RecvError::Closed) => {
// The sender has shut down, exit.
info!("Closing the event cache global listen task because receiver closed");
break;
}
}
Expand Down

0 comments on commit fb54e86

Please sign in to comment.