Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Sep 18, 2023
1 parent 35885d3 commit 8e582da
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions livekit/src/rtc_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ impl EngineInner {
if self.full_reconnect.load(Ordering::SeqCst) {
if i == 0 {
let (tx, rx) = oneshot::channel();
self.engine_emitter.send(EngineEvent::Restarting(tx)).await;
rx.await;
let _ = self.engine_emitter.send(EngineEvent::Restarting(tx)).await;
let _ = rx.await;
}

log::error!("restarting connection... attempt: {}", i);
Expand All @@ -541,15 +541,15 @@ impl EngineInner {
log::error!("restarting connection failed: {}", err);
} else {
let (tx, rx) = oneshot::channel();
self.engine_emitter.send(EngineEvent::Restarted(tx)).await;
rx.await;
let _ = self.engine_emitter.send(EngineEvent::Restarted(tx)).await;
let _ = rx.await;
return Ok(());
}
} else {
if i == 0 {
let (tx, rx) = oneshot::channel();
self.engine_emitter.send(EngineEvent::Resuming(tx)).await;
rx.await;
let _ = self.engine_emitter.send(EngineEvent::Resuming(tx)).await;
let _ = rx.await;
}

log::error!("resuming connection... attempt: {}", i);
Expand All @@ -560,8 +560,8 @@ impl EngineInner {
}
} else {
let (tx, rx) = oneshot::channel();
self.engine_emitter.send(EngineEvent::Resumed(tx)).await;
rx.await;
let _ = self.engine_emitter.send(EngineEvent::Resumed(tx)).await;
let _ = rx.await;
return Ok(());
}
}
Expand All @@ -584,10 +584,11 @@ impl EngineInner {
self.connect(url, token, options).await?;

let (tx, rx) = oneshot::channel();
self.engine_emitter
let _ = self
.engine_emitter
.send(EngineEvent::SignalRestarted(tx))
.await;
rx.await;
let _ = rx.await;

let handle = self.running_handle.read().await;
let session = &handle.as_ref().unwrap().session;
Expand All @@ -602,12 +603,13 @@ impl EngineInner {
session.restart().await?;

let (tx, rx) = oneshot::channel();
self.engine_emitter
let _ = self
.engine_emitter
.send(EngineEvent::SignalResumed(tx))
.await;

// With SignalResumed, the room will send a SyncState message to the server
rx.await;
let _ = rx.await;

// The publisher offer must be sent AFTER the SyncState message
session.restart_publisher().await?;
Expand Down

0 comments on commit 8e582da

Please sign in to comment.