From 0ab12fe969503fc9936fd843139af85dfc5179e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 12 Oct 2020 12:50:03 +0200 Subject: [PATCH] examples: Add some whitespace to the autojoin example. --- matrix_sdk/examples/autojoin.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/matrix_sdk/examples/autojoin.rs b/matrix_sdk/examples/autojoin.rs index ca757244..a5edc34b 100644 --- a/matrix_sdk/examples/autojoin.rs +++ b/matrix_sdk/examples/autojoin.rs @@ -35,15 +35,19 @@ impl EventEmitter for AutoJoinBot { let room = room.read().await; println!("Autojoining room {}", room.room_id); let mut delay = 2; + while let Err(err) = self.client.join_room_by_id(&room.room_id).await { - // retry autojoin due to synapse sending invites, before the invited user can join - // for more information see https://github.com/matrix-org/synapse/issues/4345 + // retry autojoin due to synapse sending invites, before the + // invited user can join for more information see + // https://github.com/matrix-org/synapse/issues/4345 eprintln!( "Failed to join room {} ({:?}), retrying in {}s", room.room_id, err, delay ); + delay_for(Duration::from_secs(delay)).await; delay *= 2; + if delay > 3600 { eprintln!("Can't join room {} ({:?})", room.room_id, err); break;