Skip to content

Commit

Permalink
Fix Interval usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 8, 2021
1 parent 8e275d9 commit 7edb1eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libsignal-service-actix/src/websocket.rs
Expand Up @@ -67,12 +67,13 @@ where
let mut ka_interval = actix::clock::interval_at(
actix::clock::Instant::now(),
push_service::KEEPALIVE_TIMEOUT_SECONDS,
)
.fuse();
);

loop {
let mut tick = ka_interval.tick().fuse();
futures::pin_mut!(tick);
futures::select! {
_ = ka_interval.next() => {
_ = tick => {
log::trace!("Triggering keep-alive");
if let Err(e) = incoming_sink.send(WebSocketStreamItem::KeepAliveRequest).await {
log::info!("Websocket sink has closed: {:?}.", e);
Expand Down

0 comments on commit 7edb1eb

Please sign in to comment.