Skip to content

Commit

Permalink
fix: Internode communication should be compressed too
Browse files Browse the repository at this point in the history
  • Loading branch information
akiradeveloper committed Nov 5, 2024
1 parent 42ee582 commit a75b905
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sorock/src/service/raft/communicator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod stream;
use heartbeat_multiplex::*;
use std::sync::Arc;
use tokio::task::AbortHandle;
use tonic::codec::CompressionEncoding;

pub struct HandleDrop(AbortHandle);
impl Drop for HandleDrop {
Expand All @@ -31,6 +32,8 @@ impl RaftConnection {

let chan = endpoint.connect_lazy();
raft::RaftClient::new(chan)
.send_compressed(CompressionEncoding::Zstd)
.accept_compressed(CompressionEncoding::Zstd)
};

let heartbeat_buffer = Arc::new(HeartbeatBuffer::new());
Expand Down

0 comments on commit a75b905

Please sign in to comment.