fix: multiple federation/pusher fixes

This commit is contained in:
Timo Kösters 2021-03-16 18:00:26 +01:00
parent 21f785d530
commit 44425a903a
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
7 changed files with 85 additions and 167 deletions

View file

@ -315,7 +315,7 @@ pub async fn sync_events_route(
(None, None, Vec::new())
};
let state_events = if dbg!(joined_since_last_sync) {
let state_events = if joined_since_last_sync {
current_state
.into_iter()
.map(|(_, pdu)| pdu.to_sync_state_event())
@ -703,12 +703,7 @@ pub async fn sync_events_route(
if duration.as_secs() > 30 {
duration = Duration::from_secs(30);
}
let delay = tokio::time::sleep(duration);
tokio::pin!(delay);
tokio::select! {
_ = &mut delay, if delay.is_elapsed() => {}
_ = watcher => {}
}
let _ = tokio::time::timeout(duration, watcher).await;
}
Ok(response.into())