ソースを参照

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 => {