Skip to content

Commit

Permalink
refactor: include pings in WebSocket activity (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Feb 13, 2025
1 parent 050f97f commit 8e69f5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boltzr/src/api/ws/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,16 @@ where
}
},
Message::Ping(payload) => {
last_activity = Instant::now();

if let Err(err) = ws_sender.send(Message::Pong(payload)).await {
trace!("Could not respond to ping: {}", err);
break;
}
},
Message::Pong(_) => {
last_activity = Instant::now();
},
Message::Close(_) => {
break;
},
Expand Down

0 comments on commit 8e69f5b

Please sign in to comment.