Allow a custom heartbeat interval

This commit is contained in:
Evie Viau 2022-02-17 19:41:03 -05:00
parent 1e2caf12b8
commit 3b3c35f131
No known key found for this signature in database
GPG key ID: DBCFB51C41FF87FF

View file

@ -70,7 +70,10 @@ async fn handle_conn(peer: SocketAddr, stream: TcpStream) -> tokio_tungstenite::
&SocketMessage {
op: HELLO,
d: MessageData::HELLO {
heartbeat_interval: 1000,
heartbeat_interval: env::var("HEARTBEAT_INTERVAL").
unwrap_or("1".to_string())
.parse::<i32>()
.unwrap_or(1),
nonce
}
}