refactor(build): reformat code and add tonic health dependency
- Reformatted build script with proper indentation and line breaks - Added tonic-health dependency to Cargo.toml and updated lock file - Improved error handling in disk cache with concurrent deletion checks - Refactored conditional chains using && and let expressions - Reformatted struct initialization and function parameter lists - Added proper spacing and alignment in language stats processing - Improved assertion formatting in test cases - Reorganized import statements and code layout in multiple files - Updated metrics functions with better parameter handling and formatting
This commit is contained in:
+23
-4
@@ -159,7 +159,6 @@ pub enum GitNodeMessage {
|
||||
TriggerElection,
|
||||
|
||||
// ── Raft consensus messages ──────────────────────────────
|
||||
|
||||
/// AppendEntries RPC: Leader → Follower log replication.
|
||||
#[rpc]
|
||||
AppendEntries(AppendEntriesRequest, RpcReplyPort<AppendEntriesResponse>),
|
||||
@@ -418,7 +417,16 @@ impl BytesConvertable for AppendEntriesRequest {
|
||||
});
|
||||
}
|
||||
let leader_commit = read_u64(&bytes, &mut offset);
|
||||
Self { version, term, leader_id, leader_grpc_addr, prev_log_index, prev_log_term, entries, leader_commit }
|
||||
Self {
|
||||
version,
|
||||
term,
|
||||
leader_id,
|
||||
leader_grpc_addr,
|
||||
prev_log_index,
|
||||
prev_log_term,
|
||||
entries,
|
||||
leader_commit,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +465,14 @@ impl BytesConvertable for AppendEntriesResponse {
|
||||
let match_index = read_u64(&bytes, &mut offset);
|
||||
let conflict_index = read_u64(&bytes, &mut offset);
|
||||
let conflict_term = read_u64(&bytes, &mut offset);
|
||||
Self { version, term, success, match_index, conflict_index, conflict_term }
|
||||
Self {
|
||||
version,
|
||||
term,
|
||||
success,
|
||||
match_index,
|
||||
conflict_index,
|
||||
conflict_term,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +517,11 @@ impl BytesConvertable for ReadIndexResponse {
|
||||
let commit_index = read_u64(&bytes, &mut offset);
|
||||
let leader_term = read_u64(&bytes, &mut offset);
|
||||
let is_leader = bytes.get(offset).copied().unwrap_or(0) == 1;
|
||||
Self { commit_index, leader_term, is_leader }
|
||||
Self {
|
||||
commit_index,
|
||||
leader_term,
|
||||
is_leader,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user