Skip to content

Commit

Permalink
msg
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketfuryrocks committed Dec 16, 2021
1 parent c345972 commit 60418d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pipelines/web/server/ws_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use actix::prelude::*;
use actix::{Actor, StreamHandler};
use actix_web_actors::ws;
use anyhow::Context;
use log::warn;
use std::time::{Duration, Instant};
use tokio::sync::watch;

Expand Down Expand Up @@ -62,7 +63,7 @@ impl Actor for WsActor {
_ => adds
.send(k.clone())
.await
.with_context(|| "Unable to send msg to actor")
.context("Unable to send msg to actor")
.unwrap(),
}
} else {
Expand All @@ -75,7 +76,7 @@ impl Actor for WsActor {
ctx.run_interval(HEARTBEAT_INTERVAL, |act, ctx| {
// check client heartbeats
if Instant::now().duration_since(act.heartbeat) > CLIENT_TIMEOUT {
eprintln!("Websocket Client heartbeat failed, disconnecting!");
warn!("Websocket Client heartbeat failed, disconnecting!");
ctx.stop();
} else {
ctx.ping(b"");
Expand Down

0 comments on commit 60418d1

Please sign in to comment.