소스 검색

Remove timer once fired.

Jing Yang 5 년 전
부모
커밋
25e1c30f5c
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/lib.rs

+ 3 - 1
src/lib.rs

@@ -324,7 +324,9 @@ impl Raft {
                                 // If the next election is cancelled before we
                                 // are back on wait, timer_count will be set to
                                 // a different value.
-                                break Some(timer_count);
+                                guard.0 += 1;
+                                guard.1.take();
+                                break Some(guard.0);
                             }
                         },
                         None => {