Parcourir la source

Remove timer once fired.

Jing Yang il y a 5 ans
Parent
commit
25e1c30f5c
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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 => {