Skip to content

Commit

Permalink
chore: apply suggestions from CR
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jul 12, 2024
1 parent 9fef347 commit 7dda31c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/meta-srv/src/election/etcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ impl Election for EtcdElection {
let mut keep_alive_interval =
tokio::time::interval(Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS));
loop {
let _ = keep_alive_interval.tick().await;

// The keep alive operation MUST be done in `META_KEEP_ALIVE_INTERVAL_SECS`.
match timeout(
Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS),
Expand All @@ -245,7 +243,7 @@ impl Election for EtcdElection {
.await
{
Ok(Ok(())) => {
// Do nothing
let _ = keep_alive_interval.tick().await;
}
Ok(Err(err)) => {
error!(err; "Failed to keep alive");
Expand Down

0 comments on commit 7dda31c

Please sign in to comment.